473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Handling two javascripts in IE

6
Hi,

I have a Flash menu (Flash MX) and it has links that will open in a <div> in my html document, through a javascript function.

Flash code relating to the javascript:
getURL("javascript:loadLeft('esquerda', '" + subleft[__reg3][__reg2] + "','400','179')" );
getURL("javascript:loadPage('conteudo', '" + subLink[__reg3][__reg2] + "','400','721')" );

Javascript in the HTML document:

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2.  
  3. function loadLeft(id,url,varheight,varwidth) {
  4.  
  5. // create iframe inside content div
  6. document.getElementById(id).innerHTML = "<iframe name='IFrameLeft' frameborder='no' scrolling='no' width='" + varwidth +"' height='" + varheight + "'></iframe>";
  7.  
  8. // set the iFrame's height
  9. document.all.IFrameLeft.height = varheight;
  10.  
  11. // insert content of HTML file into created iframe
  12. document.all.IFrameLeft.src = url;
  13. }
  14.  
  15. </script>
  16.  
  17. <script language="JavaScript">
  18.  
  19. function loadPage(id,url,varheight,varwidth) {
  20.  
  21. // create iframe inside content div
  22. document.getElementById(id).innerHTML = "<iframe name='IFrameContent' frameborder='no' scrolling='no' width='" + varwidth +"' height='" + varheight + "'></iframe>";
  23.  
  24. // set the iFrame's height
  25. document.all.IFrameContent.height = varheight;
  26.  
  27. // insert content of HTML file into created iframe
  28. document.all.IFrameContent.src = url;
  29. }
  30.  
  31.  
  32. </script>
  33.  
This is what happens, basically, or what I want to happen:
There's two <div>, one named "esquerda" and the other named "conteudo", and each link in flash orders the to open a different ifram on each. This is to avoid a framed site, that in this case doesn't make the trick. This works beautifully in Firefox, but not in IE, where it only opens one of the iframes.

The question is: wha'ts wrong with the code that makes IE not to handle it well?

Thanks in advance!
Feb 18 '08 #1
8 1230
xiks
6
Here you can see it working:
http://www.dreamfeel.pt/index_relativo.html
Feb 18 '08 #2
gits
5,390 Expert Mod 4TB
what to do on the page to see the error? IE shows some errors right after the page is loaded ... i assume from here:

Expand|Select|Wrap|Line Numbers
  1. onLoad = "MM_preloadImages('imgs/gerais/bot_es-ovr.gif','imgs/gerais/bot_fr-ovr.gif')"
where is that code included?

kind regards
Feb 18 '08 #3
xiks
6
Hello,

That problem is solved, now. It was related with 2 rollover images. However, the main problem is still there.
Feb 18 '08 #4
xiks
6
There are 2 of the buttons on the flash menu that are working for now, for testing.
They are, rolling over the 'DreamWeb' area and in it's submenu, the items that are working (at least in Firefox!) are the two first links on the left.
Feb 18 '08 #5
gits
5,390 Expert Mod 4TB
Firebug in Firefox still states: MM_preloadImages is not defined ... so fix that first. the dropdown tries to use the window.onload event but the document itself uses it already with the dreamweaver-code ... use an init-function and combine the calls in case you need them all. i assume the leftFrame-loading is not working in IE? so try to alert the params and the innerHTML from the related function ... what do you get alerted?

kind regards
Feb 19 '08 #6
xiks
6
Hi again,

I didn't even know about the error console in Firefox... duh! Tha'ts great. Well, I've solved the load images error and, when we click one of the two working links in flash we get some "Non-standadard with W3c" errors, but I don't know how to make them w3c compliant because I know nothing about Javascript... It might be that what's causing the problem in IE.....?
Feb 19 '08 #7
gits
5,390 Expert Mod 4TB
you could/should use for example:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('your_id').src = 'your_src';
instead of document.all best way would be:

Expand|Select|Wrap|Line Numbers
  1. // store a reference to the node (element) with id = 'your_id'
  2. var node = document.getElementById('your_id');
  3.  
  4. // now you may set some attributes and/or properties with:
  5. node.setAttribute('attr_name', 'attr_value');
  6. node.property_name = 'property_value';
  7.  
kind regards
Feb 19 '08 #8
xiks
6
Thank you.
I'll get someone here who know something about programming sintax to try that.

I'll tell you what happened then.
Feb 19 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Kerberos | last post by:
When I deliver a page as text/html, the javascripts work, but if delivered as application/xhtml+xml, the javascripts don't work: function OpenBrWindow(theURL,winName,features, myWidth, myHeight,...
2
by: sdvoranchik | last post by:
We have an application that contains links that run javascripts to create pages in a separate frame. When these links open an external site, it causes the javascripts to no longer function. When...
2
by: LC's No-Spam Newsreading account | last post by:
I asked a couple of days ago about the following arrangement (simplified). I made some progress using netscape.security.PrivilegeManager.enablePrivilege but still have to ask some further help. ...
4
by: David Virgil Hobbs | last post by:
My web host inserts banner ads into my html pages. The javascript in these banner ads interferes with the onload triggered javascript functions in my pages. Whether I trigger my javascript...
4
by: swayze | last post by:
Hi, I'm sending some vars to php from javascript. These vars contain special chars (like "&" ,",")and also turkish characters. Therefore I'm using javascripts escape() function to be able to...
2
by: Pavils Jurjans | last post by:
Hello, I am looking fow C# equivalent of JavaScripts escape() and unescape() functions. I need to use C# function at the server side and then be able to use the opposite at the client side. ...
1
by: somaskarthic | last post by:
Hi In my PHP page while viewing the page source , it shows all the javascript codings and php comments. I don't want these comments and javascripts visible . Is there any methods to hide the...
2
by: stroumf | last post by:
Hey, My problem is the following: I need to use functions from different javascripts and I don't want to load all the javascripts initially. So I need to load the scripts on demand. Now I know...
4
by: januarynow | last post by:
Generally, my site contains javascripts (a couple of freebie counters plus some CPM (pay-per-impression) and CPC (pay-per-click) ads), from four different firms, but they are all suffering from the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.