Jump to content

mayfair

Newly Registered
  • Posts

    71
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mayfair's Achievements

Member

Member (2/5)

1

Reputation

  1. Thanks for the suggestions. I already have a thin skyscraper banner and I didn't want to put any more in for fear of overcrowding. As for the blog widgets - I already use those on the right-hand column where there is more space to put text. I guess I'll keep researching other similar websites and see how they make better use of their space
  2. Howdy, I was wondering if anybody out there uses a design with a 120px column and if so what content do you fill it with? I use a 3-column layout for advertisement purposes: [120] [520] [300] but I've been scratching my head lately for inspiration for what to put in the 120px column other than my existing navigation menu and a 120x600 skyscraper. It's too thin for social media widgets and anything wordy unless the text is reduced to ~10pt. Does anyone have a similar scenario or know of any creative ideas I can steal
  3. Hi haku, many thanks for your suggestion. Yes you are correct, but what I meant to say was you cannot call a function from an onload event anywhere other than the body of the document with a strict doctype. The thought hadn't occured to me to create and update the <p> tags using JS. I will have a bash at this now.
  4. Thanks for the reply thorpe, unfortunately it's not that simple. The JavaScript has to be called when each cell in a table loads to produce a "loading" effect where the cell contents appear after a few seconds. I've tried using an external JS file and calling a function bound to an onload event, but you can't have that on a Strict doctype either. This is what i've got so far: http://www.compareholidaymoney.com. This nearly validates apart from the Facebook "Like" button and the problem I described in my original post. What makes this even more difficult is the code is generated by PHP, so I have to write the JS inside PHP. I know that usually you would achieve this kind of thing with AJAX, but I don't know how to program it and I like to write all of my own code. To get the images to load, I set a 1px .GIF in place of the image, then use my nested JS to change it's SRC. In case you might be able to help any further, here is the code that is producing the invalid code: echo " <td class='delivery'> <div id='delivery".$row_number."'><img src='assets/images/loading.gif' alt='Loading'/></div> <script type='text/javascript'> setTimeout(\"document.getElementById('delivery".$row_number."').innerHTML='".$row['delivery']."'\",rand_num); </script> </td> "; where $row['delivery'] is called from a database and contains <p>text like this</p><p>with paragraph tags</p> Any other ideas would be much appreciated
  5. Hi Guys, Can somebody confirm for me whether or not you can insert HTML tags using innerHTML with a Strict Doctype? For example This validates: document.getElementById('something').innerHTML='blah'; This does not: document.getElementById('something').innerHTML='<p>blah</p>'; The error message produced by the validator claims "document type does not allow element "p" here". I need to enter multiple lines of text from a DB into a table cell. I have tried using <br/> tags and <ul>'s and the validator kicks off about all of them with the same response. Thanks in advance
  6. Hey Guys, I've got a table that contains an undetermined number of rows that I wanted to apply some kind of 'loading' effect to. I was originally going to use innerHTML or something similar, but after reading about the lack support for it in certain browsers, I decided to try and write some simple JS that hides/unhides each row of the table as it loads. My JavaScript skills aren't great, but I managed to achieve the desired effect. Unfortunately, I used the onLoad function on images which I realise now is not compliant with a STRICT doctype, nor does it validate to AAA2 accessibility standards. I have tried searching for an alternative, but as yet have come up with nothing. Let me explain a little bit more about how my code works: Each row of the table contains an image in the first column. When this image loads, it calls a function that instantly sets the row visibility to hidden, effectively hiding the row before it even appears on the screen. Then after a small, random amount of time, I set the row visibility back to visible. I can post the code here if it would help, or you can see the table in action here: www.compareholidaymoney.com (the function called by onload is located in an external file referenced in the header: index-js.js) What I would like to know is if there is an alternative to onload that I could use to achieve a similar effect that is compliant, and if not what the best way of achieving this effect would be. Thanks in advance to anyone that might be able to help. -mayfair
  7. Hi Wildbug, Many thanks for your reply and suggestions. I've implemented your code and it works nicely. -Mayfair
  8. Hi Guys, I'm trying to sort some multidimensional arrays, but my JavaScript skills are somewhat lacking. Here is the scenario: I have an (undetermined) number of multidimensional arrays that store the exchange rates for a particular company that look something like the following: supplier['company1']['eur'] = 1.1111; supplier['company1']['usd'] = 2.2222; supplier['company1']['cad'] = 3.3333; supplier['company2']['eur'] = 1.1111; supplier['company2']['usd'] = 2.2222; supplier['company2']['cad'] = 3.3333; supplier['company3']['eur'] = 1.1111; supplier['company3']['usd'] = 2.2222; supplier['company3']['cad'] = 3.3333; What I would like to be able to do is find the company with the highest exchange rate for a particular currency out of these arrays by using the onChange event of a drop down list. The VALUE of the drop down list is the currency symbol, so I can basically use that when the function runs to set which currency to search for. So for example; if I select Euros from the drop down list, it will search the arrays for the company with the highest 'eur' rate, and return the company name and eur rate associated with it. Thanks in advance to anyone who might be able to help.
  9. Hello guys, I hope I can explain this clearly. I have a number of variables that are created inside a loop containing results from mysql_fetch_array: for ($i=1; $i<=7; $i++) { $row = mysql_fetch_array($result); $EUR[$i] = $row['EUR']; $USD[$i] = $row['USD']; $AUD[$i] = $row['AUD']; $NZD[$i] = $row['NZD']; $CAD[$i] = $row['CAD']; } So I can now call any particular value by echoing say "$EUR[2]" or "$USD[5]". Next I have two variables that are created using $_GET - $currency - which can be "EUR", "USD", "AUD" etc. and $delivery_period - which can be 1, 2, 3 etc. What I would like to be able to do is concatenate $currency and $delivery_period to form $EUR[3] or $USD[1] etc. so I can actually echo the value in the corresponding array on-screen. My PHP skills aren't that strong and I was told the solution maybe used eval() but I can't get anything to work. Any help would be greatly appreciated
  10. I did wonder if that was the case, but in the event of a spelling mistake, surely a global find and replace wouldn't be too difficult to pull off? In terms of disk space, would a completely new table with 2 columns really be much more smaller than storing say a VARCHAR(50)?
  11. Thanks for your reply ignance. I appreciate the answer depends on how the database will eventually be used, I just wanted to make sure there wasn't a definiate "yes, always do that!" answer because of some obvious reason I had missed. For the record, we will not be needing to query the database just to display a list of counties; they form a required part of the address system that will be pulled out on an individual customer basis as and when it's needed. This project is not something we have been asked to do, it's just something we're looking at in our spare time. Fortunately this means we have all the time in the world to plan it, I just want to make sure we do it right from step one
  12. Hi All, Im in the process of designing/building a new database with a colleague that we're having some minor issues with. Rather than try and explain it, its probably easier if I just give an example so here goes: We have a 2 or 3 tables in the database that require a 'county' field as part of an address. Obviously there is only a finite number of possible counties, but my colleague has suggested that we create a new table (called counties) that contains 2 columns: county_id which is an auto-increment PK and county_name which is a varchar that contains the name of the county. His logic is that because 'county' is repeated in a couple of tables throughout the database, it would be better to store counties in its own table and reference just the county_id as and when we need to refer to it. I see were he's coming from, but I just don't really like the feel of it! More than anything, it makes the tables a bit confusing in their raw format because its just bunches of numbers which don't mean a lot without the reference table. County is the example I used above, however we have the same scenario with about 5 other fields in our database. My question is this: is it really that much more efficient or beneficial to store these fields in their own seperate table or are we over-compliacting things? Ideally, I would like to see 'county' stored as a varchar the same as address1, address2, town etc. is. The database will eventually have about 300k records in it and will grow by 100-150k each year so performance does have to be taken into consideration. Thanks
  13. Hi Guys I have a quick question regarding HTTPS. We have a certificate that covers our entire site; it is installed correctly and works fine, but if a user arrives on the site by typing in the URL directly, they are taken to the unsecured version by default. I have used the <base> tag in the header to direct the user to the secure url if they click any links - which works fine in FF but not at all in IE. Is there some additional info I need to add for this to work in IE? And actually while im at it.. what is the propper way of re-directing to a secure URL? I suppose the other option would be to user a header re-direct? Thanks in advance.
  14. Thanks mjdamato, your right; I forgot to include the counter in my first post - I got a bit too trigger happy with the editing! Your form object method also looks like it would work, if I run into problems with my current method i'll give that a go
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.