LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Linux and JavaScript popup problem (https://www.linuxquestions.org/questions/linux-general-1/linux-and-javascript-popup-problem-325003/)

turk99 05-19-2005 08:43 AM

Linux and JavaScript popup problem
 
I am building a simple web page, and I have one uses who uses firefox and Linix. Non of my javaScript is working for him. For example, this link should pop up a new window, but does not for him. It's very basic javaScript, and I'm wondering if there is anything I should know b/c it's Linux.

<A HREF="#" onclick="javascript:openWindow(content='../includes/repHelpEE.cfm?id=4')">How do I correct my balances?</A>

function openWindow(content)
{
PopUp=window.open(content,"PopUp","width=600,height=325,scrollbars=1,toolbar=0,menubar=0,top=0,left= 300,");
PopUp.focus();
}

trickykid 05-19-2005 09:02 AM

Perhaps its blocking it cause he has popups disabled? I've seen some javascript do such things where Firefox is thinking its an unrequested popup. Or he simply doesn't have javascript enabled in his browser.

turk99 05-19-2005 09:12 AM

I asked and he said javaScript is enabled, and he doesn't have a popUp blocker.

trickykid 05-19-2005 09:16 AM

Quote:

Originally posted by turk99
I asked and he said javaScript is enabled, and he doesn't have a popUp blocker.
Firefox has a built-in popup blocker.. ;)

turk99 05-19-2005 09:20 AM

right, but he said it's disabled.

there is also some additional javaScript that isn't working. for example, form validations. Basic stuff to make sure there are no blank fields.

everything is fine on IE, Netscape, Mozilla, Camino, Firfox, Mac and XP. UGH!

trickykid 05-19-2005 09:31 AM

Quote:

Originally posted by turk99
everything is fine on IE, Netscape, Mozilla, Camino, Firfox, Mac and XP. UGH!
If you've tested it but it doesn't work on his and only his.. something wrong with his browser.. so its something he should worry about. Perhaps he should test it with a different browser on his machine.. but I wouldn't let one machine worry you.. if you provide a link, I'm sure dozens here would test it for you.. ;)

turk99 05-19-2005 10:20 AM

Not knowing anything about Linux, does it handle javaScripting more stringently than other OS's and browsers.

For example, I have a variable that is set to either a number or nothing, do you think that would trip it up.

sometimes it's this:

var vacation = 12;

and sometimes it's this:

var vacation = ;

trickykid 05-19-2005 10:23 AM

At times. IE is the worst to comply with the w3c standards for web pages and development. Something that might work in IE since it renders everything and usually renders it when it shouldn't usually won't work in the browsers that comply with these standards, like every other browser besides IE. Can you tell, I hate IE.. ;)

theYinYeti 05-19-2005 10:44 AM

Re: Linux and JavaScript popup problem
 
Quote:

Originally posted by turk99 <A HREF="#" onclick="javascript:openWindow(content='../includes/repHelpEE.cfm?id=4')">How do I correct my balances?</A>

function openWindow(content)
{
PopUp=window.open(content,"PopUp","width=600,height=325,scrollbars=1,toolbar=0,menubar=0,top=0,left= 300,");
PopUp.focus();
}
From my experience, Gecko's handling (Firefox, Mozilla, Ns7+...) of Javascript is the best available.

If you'll permit, I think href="#" is a bad habit. It is meaningless, and I've seen this kind of URL badly handled by some browsers. I usually had better luck with href="javascript:void()". But none of the two is the perfect solution, though. There just shouldn't be a href at all, or it should at least be empty, but I'm not sure most browsers would appreciate that :)

I don't know if this will solve your problem, but it's worth a try...

Yves.

[edit:]I don't understand! I tried editing this post twice, but the ONE-WORD "javascript" above keeps breaking into two words! It should read: "javascript:void()" all without any space at all.[/edit]


All times are GMT -5. The time now is 10:56 AM.