Page 1 of 1

problem with opening url in frame please help

Posted: Wed Jul 02, 2003 11:27 am
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

Posted: Wed Jul 02, 2003 1:17 pm
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.

extra comma

Posted: Wed Jul 02, 2003 1:21 pm
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

now i understand!

Posted: Wed Jul 02, 2003 1:31 pm
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