PDA

View Full Version : DHTML Window widget (v1.03)



mwh65
10-05-2007, 07:37 PM
1) Script Title: DHTML Window widget (v1.03)

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem: I have successfully installed the above widget but I get a javascript error. The window loads but no content is displayed. I have the window set to iframe and the javascript error is window.frames[...].location is null or not an object.

Any ideas ?

EDIT: To make things even more odd the script on my page WORKS in Firefox 2 but not in Internet Explorer 7 !!!

ddadmin
10-06-2007, 10:06 AM
Please post a link to the page on your site that contains the problematic script so we can check it out.

mwh65
10-06-2007, 10:40 AM
No problem ...

http://www.agls.org.uk/forum/activity.php

Click on one of the game links to open the DHTML window eg Drop Blocks. Please note this will also open a standard window which will be in front of the DHTML one.

You will need to login with the following temporary account details ...

username : scrapper
password : tester

twohawks
10-07-2007, 12:34 AM
You need to add return false to your onclick handler for the dhtml window link not to be followed unless javascript is off in the user's browser.
Something like...
onclick="blur(); return false "

As for the content, it does appear in Firefox, just fyi.

I did notice that in your header the script tag is not closed, as well as you seem to be missing the copyright notice for dhtmlwindow :eek:

As far as closing tags, I notice you are using the <script .... /> convention. There is a known IE issue with this. (search google for "closing script tag" and you will find pages such as this one (http://webbugtrack.blogspot.com/2007/08/bug-153-self-closing-script-tag-issues.html) describing the issue.

Anyway, you might try changing the code to something like:

<script language="JavaScript" type="text/javascript" src="./popup/dhtmlwindow.js">
<!--
/***********************************************
* DHTML Window Widget- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//-->
</script>

Older convention, most proper. And don't forget to give credit where its due ;^)

mwh65
10-07-2007, 04:19 PM
Well unfortunately nothing you suggested worked :mad:

In fact amending the onlick event to onclick="blur(); return false" stopped the javascript function from running altogether !!! Just to check, it didn't work in FireFox 2 either.

Obviously I have had to remove the return false from the onclick event as the site is live but have left your other suggestion in regarding the closing tag etc.

Obviously the script runs so far but the content of the window generates the

window.frames[...].location is null or not an object

error.

twohawks
10-07-2007, 06:12 PM
Hmmm... did you see this thread, maybe it will help...
Need help opening DHTML Window widget into other frame (http://www.dynamicdrive.com/forums/showthread.php?t=21505&highlight=frames+widget)

mwh65
10-07-2007, 06:50 PM
The link I provided was a direct link to the page without frames.

http://www.agls.org.uk/forum/activity.php

ddadmin can you think of anything here that I haven't thought of ?

If push comes to shove I will have to remove the script and find another but it will be a shame.

mwh65
10-07-2007, 08:02 PM
Well after pulling apart the Games page script I have found the problem :o

It was the Menu script across the top. I created this drop-down menu in WebStyle 4. I've removed the menu so everyone can see the DHTML Window working. :)

As for why it doesn't work with the menu loaded is another matter but I will cross that bridge later. :rolleyes: