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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing value to function

Status
Not open for further replies.

emozley

Technical User
Joined
Jan 14, 2003
Messages
769
Location
GB
Hi,

I have a function that opens a popup

<SCRIPT>
function newwindow1(theUrl) {
window.open(theUrl, 'jav', 'width=640,height=320,resizable=no,scrollbars=auto');
}
</SCRIPT>

And a series of hyperlinks in a table that call it that pass a value to theURL

eg <a href="meetingframe.asp?StartTime=08:00:00&RoomID=2&ViewingDate=01/02/2006" title="Room 2 at 08:00 hrs" onclick="newwindow1(this.href);return false;">

I am trying to make to make it so that when the page loads if a meeting has been specified by a hyperlink the popup appears instantly. So far I have tried

<body vlink="blue" alink="blue" onLoad='newwindow1('meetingframe.asp?MeetingID=132');return false;'>

but no popup appears.

Any ideas?

Thanks very much
 
"I am trying to make to make it so that when the page loads if a meeting has been specified by a hyperlink the popup appears instantly."

I don't follow.

... but I would rethink the [red]red[/red] single quotes below, as they are now, they will probably cause funky delimitting problems.
[tt]onLoad=[red]'[/red]newwindow1('meetingframe.asp?MeetingID=132');return false;[red]'[/red][/tt]
 
if a meeting has been specified by a hyperlink

Huh? Hyperlinks don't "specify meetings" - they link to other pages.

Also, as Sheco points out, your nested single quotes are erroneous, and will be causing code to break.

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi,

Having re-read my posting it does look a bit vague! By specifying a meeting with a hyperlink I mean using a ? at the end of the URL to pass a value to another page:


The idea is that by clicking on the link it shows one page then a popup window automatically appears with details of that particular meeting.

Apologies for the confusion - in the end I swapped the end quotes for " which did the trick so thanks very much.

cheers

Ed
 
emozley,

If you are just simply wanting to have a pop-up display when you open the browser. All you need to do is change the following part of your code:

From

<body vlink="blue" alink="blue" onLoad='newwindow1('meetingframe.asp?MeetingID=132');
return false;'>

TO

<body vlink="blue" alink="blue" onLoad="newwindow1('meetingframe.asp?MeetingID=132');
return false;">

You can't have single quotations nested within themselves. But you can have single quotations nested in double quotations. When I changed this, each time I opened the page a pop-up window opened.

I hope this helps,

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top