SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using the amperstand to send values ina function in FF

    Hi people, I have the follow trouble.

    I have a function in JavaScript who fetch the content of a external file into a <div></div> label, I can use a event to call that function, the function only need two parameters

    1.- The URL of the file who will fetch.
    2.- The id if the </div> where put the content.

    getData('URL to the file', 'DivId')

    Example:

    onblur="getData('file_to_fetch.php?value=1', 'DivId')"

    Ok, when I send only ONE value (without using the & in the URL) the function works prefect in FireFox and Internet Explorer.

    But, if I need send more values in the URL and need use the & character, the function still works in IE but....doesn't works in FireFox.

    I'm sure the trouble is in the way than FF manage the & character in the URL.

    Someone know some way to fix this trouble?

    From now, thanks for any help.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Are you using & or are you using &amp; ?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Escape the ampersand by writing it as &amp;(with the semi-colon) - both IE and firefox will convert it as needed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •