Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BAD NETSCAPE!!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have this piece of code which is pretty self explanatory....
It passes a value through to the next page.........

<img src='images/viewdetails_over.gif' width='137' height='20' space='0' vspace='0' border='0' align='right' onClick=&quot;JavaScript: window.open('blank.asp?id=<%=id%>', '', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=0, width=600, height=380, left = 200, top = 150')&quot; style=&quot;cursor:hand&quot;>


It works perfectly in IE but in Netscape the button isn't clickable at all. Any ideas for a bit of code which will do the same thing in Netscape?

Many thanks

James

 
in Netscape the only way to call a javascript is through an Anchor ( <a href=&quot;javascript:....> ) or a button, but nothing else, I once had it working in IE where if I clicked an image or a table cell, it would work, but in Netscape I had to create an anchor around my image just to make it work. [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
Sorry, Karl. you're wrong. There are many other ways to invoke Javascript in Netscape. Granted, you usually have to play tricks to get Netscape to do things that are easy in IE, but it's almost always possible.

James, here's a way to do what you want. You might have to restructure your page a little, because it requires a form (not that the form never actually gets submitted, because the submit handler returns false):

<html>
<head>
<script>

function NewWin()
{
window.open('return false;
}
</script>

</head>
<body>
<form onsubmit=&quot;return NewWin()&quot;>
<input type=&quot;image&quot; src=&quot;images/viewdetails_over.gif&quot; border=0 >
</form>
</body>
<html> [sig]<p>nick bulka<br><a href=mailto: > </a><br><a href= </a><br>Get your technical books at Bulka's Books<br>
[/sig]
 
well gee I forgot about form, but for direct links, yer still pretty limited and you &quot;usually have to play tricks ...&quot; But you know what I mean, Netscape is usally a pain especially with the DOM [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
I was looking for help on this exact topic...sort of!

I'm running into the same problem, except my page is being built with VBScript instead of Java Script. I have a simple search page, and the $&%#*@! buttons have been working all day, until about an hour ago. Now the button is clickable in IE, but not Netscape!

Any suggestions???

Thanks! [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
I forgot to mention that the Netscape button works if you can get it hightlighted and hit Enter. This is IF the button even appears at all! Sometimes I can't even view it in Netscape.

(I think that's all now!)

Thanks again! [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
Dollie,
Can you post some code? [sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
I went through the site and anchored all of the submit buttons. I'm still not positive that it's going to help, but the buttons click in Netscrape now. (Wouldn't you know I get the answer once I've posted a question?) If you'd like to look at the site, I'll post a link. I'm so proud of it! I've been struggling with this over the last 8 months. Maybe another month and it won't be so pre-mature? :) [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
Its not necessarily to use javascript function
<input type=&quot;button&quot;
name=&quot;btnEdituserAddUserData&quot;
value=&quot;Save&quot;>&nbsp;<INPUT name=&quot;Button1&quot; value=&quot;New Customer&quot;type=&quot;button&quot; OnClick=&quot;location.href = 'NewCustomer.asp'&quot;> [sig][/sig]
 
Button clicking can also be handled by capturing mouse events at the document or window level and setting parameters with onMouseOver/Out at the needed places.

function init() //called at onLoad if Netscape
{
document.captureEvents(Event.MOUSEUP)
document.onmouseup = movePage
}

function movePage(evt)
{
if (N && switchToLink)
{
if (newWin) {newWin=false; openWin(currentLink); currentLink=&quot;&quot;; return false;}
else if (currentLink!=&quot;&quot;) location=currentLink;
return true;
}
//etc

example document link:
--------------------------
<a href=&quot;somelink&quot; target=_specs onMouseover=&quot;switchToLink=true; newWin=false; currentLink='somelink'&quot; onMouseout=&quot;switchToLink=false; newWin=false;&quot;><img src='button.gif'></a>


Extremely inelegant. Works however. [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top