pocobueno1388 Posted July 13, 2007 Share Posted July 13, 2007 I have this function: function showImage(id) { window.open( "inventory.php?itemID=id", "showImage", "status = 1, height = 350, width = 400, resizable = 0" ) } I am calling the function like so: <td onClick='showImage(1)'><a href="###">Link</a></td> But the "1" I am setting as the parameter for "id" is not working. It is supposed to pop up with the URL: inventory.php?itemID=1 Instead it is coming up with: [tt]inventory.php?itemID=id and not processing the "id" parameter as a variable. Here is the line that is obviously causing the problem: window.open( "inventory.php?itemID=id", "showImage", "status = 1, height = 350, width = 400, resizable = 0" ) Any help is greatly appreciated, thanks =D Link to comment https://forums.phpfreaks.com/topic/59831-solved-function-parameter-help/ Share on other sites More sharing options...
xenophobia Posted July 13, 2007 Share Posted July 13, 2007 window.open( "inventory.php?itemID=id", "showImage", "status = 1, height = 350, width = 400, resizable = 0" ) Your first parameter having problems. Should be: window.open("inventory.php?itemID=" + id, ....); You had mixed up the variable inside the string. Link to comment https://forums.phpfreaks.com/topic/59831-solved-function-parameter-help/#findComment-297578 Share on other sites More sharing options...
pocobueno1388 Posted July 13, 2007 Author Share Posted July 13, 2007 Ugh, I should have known that Thanks you very much. Link to comment https://forums.phpfreaks.com/topic/59831-solved-function-parameter-help/#findComment-297579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.