problem with opening url in frame please help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

problem with opening url in frame please help

Post by sauron98 »

Hi All

Im still having this horrible problem...

currently when a user selects a cd image, the script calls a function, opens a window and presents the data from a sql database in a preformated page heres the script:

function view(cd_id,cd_title,cd_image)
{
win1=window.open("view_cd_image.php?cd_id="+cd_id+"&cd_title="+cd_title+"&cd_image="+cd_image,"","width=650,height=250,top=100,bottom=100,left=100")
}

The problem is I need the data and the page 'view_cd_image.php' to be presented in a normal _blank browser window. Can anyone help me change this...ive tried everything. I need to be able to specify the frame it opens in

Thanks a lot
Dan
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

I am somewhat confused as to what you need. target="_blank" opens a new window, while target="framename" opens the page in a frame. They are mutually exclusive.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

extra comma

Post by phpScott »

As i think I mentioned in you other post on the same subject you have an extra comma at the end of the line where you contactinate the url string
Try this:

Code: Select all

function view(cd_id,cd_title,cd_image)
{
win1=window.open("view_cd_image.php?cd_id="+cd_id+"&cd_title="+cd_title+"&cd_image="+cd_image"","width=650,height=250,top=100,bottom=100,left=100")
}
Javascript window.opne method has a nasty little side effect when declaring its properties as you have done with hieght and width of the window. All of its additional properties are turnd on by default but if you declare one of them the rest turn to off or false so any property that you want must be set to true.

Just a little side note.

phpScott
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

now i understand!

Post by sauron98 »

thanks you guys...that note about the java 'side effects' was really useful...now i know why why they wouldnt work!

cheers...its all appreciated
Dan
Post Reply