Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Working Mechanic
Picture of celtic rugs
Posted
Hi,
I was testing out a new java script menu on my site when I noticed that the iframe does not show when using java script Confused
I was also using java script to show content but both wont work at the same time. both of them work of the same .js file but have completely seperate head and css
Anyone else come across a similar problem?
 
Posts: 26 | Registered: February 20, 2009Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
Can you post a link to the problem page? I suspect your script has a coding error.
 
Posts: 5112 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Picture of celtic rugs
Posted Hide Post
Hi larry
here is the test http://www.thecelticrugcompany.ie/test/ page. as you can see the menu on the left does not work but the content on thhe right does this can differ I think it is to do with which code is introduced first.

About the iframe i tried it again on a new page and it did work Confused

Cheers Smile
 
Posts: 26 | Registered: February 20, 2009Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
You can only use the script once on a page. The script names are not unique (on a per-script- basis), so using the script more than once will cause the script to overwrite the previous script contents, thus negating its effects.

If you can post a page with an i-frame example, I'll look at that also.
 
Posts: 5112 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Picture of celtic rugs
Posted Hide Post
I did try to change the name of the .js file for one of them but still the same result is it the script content that clashes rather than the file name?
I cannot recreate the situation were the iframe would not show Confused

Cheers Smile
 
Posts: 26 | Registered: February 20, 2009Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
It is the script content that clashes. If you really need the script twice on a page, copy the original script (ddaccordian.js) to another file (e.g., ddaccordian2.js), open it in a plain text editor, locate the line:
quote:
var ddaccordian=(
and change the var name to a different name (e.g., ddaccordian2) and then use this var name for your second menu.

Also, you do not need to add this line
quote:
</script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
</script>
more than once.
 
Posts: 5112 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Picture of celtic rugs
Posted Hide Post
Hi Larry,
Tried that still no joy I think they need to be completly different to work I'll try another one or take my finger out and make a dropdown menu myself Smile

Cheers
 
Posts: 26 | Registered: February 20, 2009Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.