View Full Version : How to make sure Javascript file load each time

07-23-2012, 04:27 PM
1) Script Title: Dynamic Ajax Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

3) Describe problem: Still having issue with insertion of Javascript

I have insert javascript and flash code (js and swf).
Here is the link of the script I'm trying to insert.

It's work OK on the first time I click on the menu item but if I browse other page and click again on the menu item it will work ok but if I do this a few time the script stop to work and seem not to load the .js again.

Here is the code for item menu on index.htm

<a href="javascript:xpage('files/profile.htm', 'content'); loadobjs('swfobject.js','embedobject.js')">Profile</a>

Here is the code for files/profile.htm

<div align="center">
<div id="template">
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

I have pasted the other code into a new js file 'embedobject.js'

swfobject.embedSWF("profile.swf", "template", "500", "363.3", "9.0.0");

I'm wondering how can I make sure the .js files are loaded everytime I click on the menu item?