Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Newbie needs help please

    Hi,

    I have a problem trying to implement a javascript cart to a webpage. When I run the code in isolation, it works fine but once I add it to my existing html page it doesn't work. I believe this is because the html page is loading some content (flash) and then will not load the javascript file.

    See line 32-34 in http://www.danceforjoytexas.com/iframe_9_recital.html and then click on Recital info

    32 <body onload="load_content()"
    33 <script type = "text/javascript"
    34 src = "sing1.js">
    Line 32 loads the flash content and this works fine
    Line 33-34 is supposed to load the javascript file but doesn't

    For some reason the sing1.js file will not load and without that the form at the very bottom of the page is not working correctly.

    Is there some way of running both the flash file AND the sing1.js file on the same page? If so, how?

    Thanks in advance - I'm still a newbie at all of this.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    You have put a carriage return into
    33 <script type = "text/javascript"
    34 src = "sing1.js">

    Make it

    <script type = "text/javascript" src = "sing1.js">

    And please have a look at the posting guidelines re silly titles.

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Apologies for the silly title..it won't happen again

    I made the suggestion you made but it's still not working.

    It loads the flash but still refuses to load the javascript. I know this because the form at the very bottom of the page should append the text field and selection fields to the item description. It is not doing this.

    The same code for the form is also here: http://www.danceforjoytexas.com/cart.html
    This is the same code and works fine, but when I insert it into the http://www.danceforjoytexas.com/iframe_9_recital.html file it won't load the js file. Please help
    Last edited by chickendonut; 02-24-2007 at 05:26 PM.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Try loading the .js script in the <HEAD> section, before the flash.

    Try loading the .js without the flash. What happens?

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This is the code in that html file
    Code:
    <body  onload="load_content()"
    <script type = "text/javascript" src  = "sing1.js"></script>
    Notice anything missing?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    Try loading the .js script in the <HEAD> section, before the flash.

    Try loading the .js without the flash. What happens?
    I tried loading in the Head section - didn't work either.

    But when I removed the flash :

    <body onload="load_content()"

    then the js loaded and ran correctly. I'm sure this is something obvious, but for the life of me I can't figure out what it is.
    Last edited by chickendonut; 02-24-2007 at 10:54 PM.

  • #7
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Quote Originally Posted by _Aerospace_Eng_ View Post
    This is the code in that html file
    Code:
    <body  onload="load_content()"
    <script type = "text/javascript" src  = "sing1.js"></script>
    Notice anything missing?
    No - you want to tell me what it is?

  • #8
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by chickendonut View Post
    No - you want to tell me what it is?
    <body onload="load_content()">

    Should have noticed this!

  • #9
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    <body onload="load_content()">

    Should have noticed this!
    OK, I corrected that but the js still does not load correctly. That line was related to the flash.

    Someone must be able to figure out why the js won't load

  • #10
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would really appreciate if someone could look into this for me. I have the live code published and want to get this sorted out as soon as possible.

    Thanks

  • #11
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    You say you can load the flash, and the JavaScript, but not both.
    This must be something quite subtle. the two are interfering with each other.
    Bear in mind that you cannot have two functions or variables with the same name.
    My suggestion is to go through your file sing1.js and rename every function and variable (e.g. with a 1 or x suffix). You should be able to use search/replace for this. Then see what happens.


  •  

    Posting Permissions

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