PDA

View Full Version : loadURL and Internet explorer 6


blueven
07-06-2006, 10:21 AM
Hi,
it is possible that LzBrowser.loadURL does't work with IE 6?

I have tis situation:

index.html-------------------------------------

<frameset cols="70%,30%" id="masterFrameset" frameborder="YES" border="3" framespacing="0" bordercolor="#E3E4E5" >

<frame src="application.html" id="application" name="application" scrolling="AUTO" >

<frameset id="emailFrameset" rows="106,*,100" frameborder="YES" border="3" framespacing="0" bordercolor="#E3E4E5" >
<frame src="emailframe.html" id="emailIntes" name="emailIntes" scrolling="no" >
<frame src="emailframe.html" id="emailframe" name="emailframe" scrolling="AUTO" >
<frame src="emailframe.html" id="emailAttac" name="emailAttac" scrolling="AUTO" >
</frameset>

</frameset>

------------------------------------------
and

in application.html i have the laszlo application!

When i make :

LzBrowser.loadURL('Mail/index.html','emailIntes');
LzBrowser.loadURL('Mail/framee.html','emailframe');
LzBrowser.loadURL('Mail/elenatt.html','emailAttac');

in IE 6 it work only the first time; the others times it doesn't work!

While in Firefox it work always!

Why? can i do anything?

d~l
07-06-2006, 11:39 AM
This symptom is known and has been discussed in several earlier threads .. (http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=3187&highlight=succession)

with LzBrowser.loadJS or LZBrowser.loadURL .. if they are called in quick succession only the last is executed in IE. They are HTTP requests and it is like clicking on HTML links in quick succession.

There are ways around this ..

you can build a javascript array containing the arguments and pass this to a javascript function in the HTML wrapper in one call which function then unpacks the array and "batch processes" the separate calls.

.. or you can try a delay between each of the calls in your OpenLaszlo app.

d~l
07-06-2006, 02:14 PM
Try this ..

In OpenLaszlo app you can create a single javascript call with a string of arguments like this ..


LzBrowser.loadURL("javascript:loadPages('Mail/index.html','emailIntes', 'Mail/framee.html','emailframe', 'Mail/elenatt.html','emailAttac')");


note: "javascript" should have no space in it ..

then in HTML wrapper (containing frameset) place this loadPages function in <head></head>


function loadPages(url1, frame1, url2, frame2, url3, frame3) {

parent.frame1.location.href = url1;
parent.frame2.location.href = url2;
parent.frame3.location.href = url3;

}

blueven
07-07-2006, 04:47 AM
The javascript console tell me:

"loadpages is not defined"

I placed the function in head of the html wrapper containing the frameset!

Doesn't work!

d~l
07-07-2006, 05:01 AM
.. "loadpages is not defined" ..

check the consistency of spelling .. my code had loadPages not loadpages .. it doesn't really matter provided that syntax is consistent.

And another point .. where is the lzxapp.swf embedded (loadURL expects the javascript to be in same page)? Perhaps lzxapp.swf can't find javascript function?

Try placing the javascript function loadPages() in application.html (the HTML wrapper for lzxapp.swf) instead of index.html.

If you have Firefox browser, use Tools | DOM Inspector to view your pages.

blueven
07-07-2006, 06:41 AM
Then, now the function is called.
But there is a new error:

"parent.frame1 has no properties"

The name of the frame is correct, but parent.frame1 is undefined.

The funcion is in the application.html wrapper page, where i have laszlo app.

d~l
07-07-2006, 09:43 AM
It is easier to post this example .. see below ..

Refer to this 8.1.1 Building a URL (http://www.laszlosystems.com/lps-3.3/docs/guide/browser-integration.html#d0e19737)

...

this example app uses SWFObject to embed the swf ..

alert messages can be commented out ..

I do not like using framesets .. I much prefer to use div and iframe containers, with CSS stylesheet.

Same principles apply.

blueven
07-11-2006, 09:17 AM
I see that if the calls are in very fast sequence, even firefox doesn't work good.

Why the loadURL and loadJS are so inefficient?!

i must find a method for permit it to work!

d~l
07-11-2006, 10:24 AM
Does the "method" explained above not work for you?

Solution: Either have just one call (passing args) or have delays between calls.