I am trying to write a javascript code for opening a popup window. It has to pass 2 parameters to the php script.
Here is the snippet of the code:
window.open('commercial_files/ttform.php?tender_id='+result["tender_id"]&id='+result["id"],
'quotation','scrollbars=yes','menubar=no','status=no','width=800,height=600');
There is some problem with comma and apostrophe near "?". tender_id='+result["tender_id"]&id='+result["id"].
Rob Lyndon
12.7k5 gold badges56 silver badges79 bronze badges
asked Jan 21, 2017 at 10:06
Sanju Menon
7291 gold badge11 silver badges24 bronze badges
-
window.open('commercial_files/ttform.php?tender_id='+result["tender_id"]+'&id='+result["id"], 'quotation','scrollbars=yes','menubar=no','status=no','width=800,height=600');Roljhon– Roljhon2017年01月21日 10:08:16 +00:00Commented Jan 21, 2017 at 10:08
-
Thank you very muchSanju Menon– Sanju Menon2017年01月21日 10:11:44 +00:00Commented Jan 21, 2017 at 10:11
1 Answer 1
you have missed ' for &id
in
tender_id='+result["tender_id"]&id='+result["id"],
---------------------------------------------^^^----------------------
it should be like
window.open('commercial_files/ttform.php?tender_id='+result["tender_id"]+'&id='+result["id"], 'quotation','scrollbars=yes','menubar=no','status=no','width=800,height=600');
answered Jan 21, 2017 at 10:09
Pranav Patel
1,55914 silver badges28 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js