LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-27-2006, 09:32 AM   #1
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Rep: Reputation: 30
javascript problem with IE


Joh,

I'm not good with Javascript but have some basic knowledge and experience.
I have this code:
Code:
function openEditBox(idLink) {
		var width = 750;
		var height = 500;
	
		var x = parseInt(screen.width / 2.0) - (width / 2.0);
		var y = parseInt(screen.height / 2.0) - (height / 2.0);
	
		var win = window.open("popup.php?cmd=modLink&idLink="+idLink, "Modify Link", "top="+y+",left="+x+",scrollbars=no,width="+width+",height="+height+",resizable=yes");

		if (win == null) {
			alert('Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.');
			return;
		}
		
		win.focus();
}
Well, as u see, nothign special. Just a function that opens a pop-up where u can edit a link.
I call this function like this:

Code:
<a href="#" onClick="javascript:openEditBox(183)">a link of id 183</a>
Well, Firefox doesn't have any with this link and as I know there isn't anything "wrong" that I'm doing in this codes.
But IE is having trouble with it.
IE is having trouble this line (invalid argument):
Code:
var win = window.open("popup.php?cmd=modLink&idLink="+idLink, "Modify Link", "top="+y+",left="+x+",scrollbars=no,width="+width+",height="+height+",resizable=yes");
Well, I tryed to figure out what the problem is. I removed all the variables and replaced them with my own context, then it worked.
If I try to add just 1 variable, I get this error. It doesn't matter what variable I use, idLink, width,x, y, etc.


Can somebody help me?
What's the problem of IE? Firefox isn't giving me any error and works fine.

Greetz,

alitrix

Last edited by alitrix; 05-27-2006 at 05:43 PM.
 
Old 05-27-2006, 04:43 PM   #2
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
I dont know if it is the posting system parsing your code, but there appears to be something wrong with your quotes on that line. Do you want to double check that they are paired properly? The top argument is either missing, or has an additional quote, and the resizable one too.

Danny
 
Old 05-27-2006, 05:40 PM   #3
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Original Poster
Rep: Reputation: 30
I didn't understand what u mean

I checked the code, there isn't anything missing. That's the only code that I have, if u mean that.
Can u please specify me what u mean?

Many tnx!
 
Old 05-27-2006, 08:57 PM   #4
RijilV
Member
 
Registered: Sep 2002
Location: somewhere
Distribution: gentoo
Posts: 123

Rep: Reputation: 15
Code:
resizable=yes"
I think that's the code in question.

could be wrong, I'm probably no help on this one
 
Old 05-28-2006, 04:16 AM   #5
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
Alitrix,

I mean that it looks very much like you have mismatched your quotes on the line in particular. Count them up, and make sure you are opening, and closing the quotes stuff where it should be. That looks to me to probably be your problem.

Danny
 
Old 05-28-2006, 04:45 AM   #6
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Original Poster
Rep: Reputation: 30
Well, I counted them and it's all oke
And if it wasn't, then Firefox told me already (I guess?)

@RijilV, There isn't anything wrong with that (if u mean the quotes part)
 
Old 05-28-2006, 09:20 AM   #7
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
The quotes are fine. Have you tried playing with the path to popup.php? Maybe put a / in front or something? Or even ./ or maybe full path with http?

Dunno just an idea. But the problem is with IE I think - the code looks fine.

Last edited by dive; 05-28-2006 at 09:22 AM.
 
Old 05-28-2006, 09:22 AM   #8
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Original Poster
Rep: Reputation: 30
Well, I don't think that helps.

U see, if I gave it a wrong URL/file , then I would get a pop-up with a 404 inside of it.
But instead of that I get a error (only in IE, FF doesn't have any trouble with it)

So I don't think IE is looking to the path's, cause it isn't even opening a pop-up
 
Old 05-28-2006, 04:46 PM   #9
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
You don't have any popup blocking IE? Just a thought.
 
Old 05-31-2006, 10:14 PM   #10
smallville
Member
 
Registered: Dec 2005
Posts: 44

Rep: Reputation: 15
your script looks like you're writing the script like this:

message="y="20", x="20""

instead of using " try this:

message="y='20', x='20'"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript coding problem Hockeyfan Programming 1 02-01-2006 07:23 AM
Linux and JavaScript popup problem turk99 Linux - General 8 05-19-2005 10:44 AM
Java/Javascript problem????? Jadewolf Linux - Software 2 10-25-2003 07:06 PM
Javascript in Linux problem? BajaNick Linux - Software 5 10-20-2003 12:41 PM
Elinks: javascript problem ashesh Linux - General 1 07-21-2003 02:06 AM


All times are GMT -5. The time now is 09:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration