...

View Full Version : Newbie needs help please



chickendonut
02-24-2007, 07:31 AM
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.

Philip M
02-24-2007, 08:39 AM
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.

chickendonut
02-24-2007, 06:10 PM
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

Philip M
02-24-2007, 10:07 PM
Try loading the .js script in the <HEAD> section, before the flash.

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

_Aerospace_Eng_
02-24-2007, 10:34 PM
This is the code in that html file


<body onload="load_content()"
<script type = "text/javascript" src = "sing1.js"></script>Notice anything missing?

chickendonut
02-24-2007, 11:48 PM
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.

chickendonut
02-24-2007, 11:49 PM
This is the code in that html file


<body onload="load_content()"
<script type = "text/javascript" src = "sing1.js"></script>Notice anything missing?

No - you want to tell me what it is?

Philip M
02-25-2007, 10:24 AM
No - you want to tell me what it is?

<body onload="load_content()">

Should have noticed this!

chickendonut
02-25-2007, 05:34 PM
<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 :confused:

chickendonut
02-26-2007, 05:34 PM
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

Philip M
02-26-2007, 05:54 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum