•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 429,995 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,422 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1344 | Replies: 2 | Solved
![]() |
•
•
Join Date: Dec 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Hi there,
I have had a script on my web site which opens a popup window when clicked. It works in Firefox and I am sure that it worked in IE6 - but it does not work in IE7.
The javascript part is from Eric King who posted the script on to DynamicDrive.com:-
The calling line is:-
Please try it at :- http://nkelsey.byethost24.com/fixtur...idweekdiv1.php
by clicking on the 'View League Table' button.
As I said, it works in Firefox but not IE7.
Can anyone help me make it work in both... or does anyone have another script or way of performing the same operation... or other idea as to how I can achieve the same end?
Thanks in anticipation.
Regards
Allan Thompson
I have had a script on my web site which opens a popup window when clicked. It works in Firefox and I am sure that it worked in IE6 - but it does not work in IE7.
The javascript part is from Eric King who posted the script on to DynamicDrive.com:-
<script language="javascript" type="text/javascript">
<!--
/****************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
This script is free to use as long as this info is left in
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';win=window.open(mypage,myname,settings);}
// -->
</script>The calling line is:-
<input name='button1' type='button' href ="2coupleweekend/table2coupleweekend1.html" title="2 Couple Weekend League - Table" onClick="NewWindow(this.getAttribute('href'),this.getAttribute('title'),'500','350','no','center');return false" value=" View League Table ">Please try it at :- http://nkelsey.byethost24.com/fixtur...idweekdiv1.php
by clicking on the 'View League Table' button.
As I said, it works in Firefox but not IE7.
Can anyone help me make it work in both... or does anyone have another script or way of performing the same operation... or other idea as to how I can achieve the same end?
Thanks in anticipation.
Regards
Allan Thompson
Last edited by ~s.o.s~ : Jun 28th, 2008 at 2:58 am. Reason: Fixed code tags; changed <icode> tags to <code> tags.
On the surface the code looks error free though I am pretty sure that IE doesn't play well with
getAttribute and setAttribute . Just replace them with this.href and this.title (or better yet, just pass this !). If you still are unable to find a solution, there are a few IE Javascript debuggers out there which you can put to good use in your case. I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
•
•
Join Date: Dec 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks for that.
I hadn't realised that IE caused a problem with this code. I searched and found many sites with information on the issue. Apparently Microsoft have decided to ignore the w3 standard and any getAtrribute in IE reveals 'null' when it shouldn't.
There doesn't seem to be a good workaround... unless anyone knows differently, of course!
Will have to think of another way.. although it seems that I may be forced to forgo the button idea entirely! Shame on Microsoft!
Allan
I hadn't realised that IE caused a problem with this code. I searched and found many sites with information on the issue. Apparently Microsoft have decided to ignore the w3 standard and any getAtrribute in IE reveals 'null' when it shouldn't.
There doesn't seem to be a good workaround... unless anyone knows differently, of course!
Will have to think of another way.. although it seems that I may be forced to forgo the button idea entirely! Shame on Microsoft!
Allan
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
avatar blue gene code css database dell development div dos dreamweaver drivers energy enterprise firefox graphics hardware html ibm ibm. news intel intel ibm internet linux medicine microsoft mozilla news open open source open-source opengl openoffice pc red hat russia software source sun super symantec tables technology ubuntu vista w3c web windows wysiwyg x86
- Firefox keeps opening multiple tabs by itself everytime I open Firefox (Viruses, Spyware and other Nasties)
- Pop Up Media Player (HTML and CSS)
- disable parent window (JavaScript / DHTML / AJAX)
- Comment Form (HTML and CSS)
- Popup window on button click (ASP.NET)
- Pop-Up Calendar for ASP (ASP)
- HELP! With Javascripts Pop-Up Window (JavaScript / DHTML / AJAX)
- hclean.exe trojan, norton anitvirus not working and google search problems (Viruses, Spyware and other Nasties)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Password Protect
- Next Thread: Browser compatibility



Linear Mode