I am working on a simple javascript program that searches for a wine review on one or several websites based on which sites the user is interested in.
My problem is that the window.open command only opens the first website chosen by the user and seems to be unable to open the others. Also, after scrolling through the urls of the sites listed, I get an error message saying: 405 – Method Not Allowed
You can check the program out at: http://www.divinocards.com/search_engine_4.htm
I have spent several hours trying to figure out why the program is stalling as it is. I have used the debugger and it seems that all values are being correctly assigned. It’s is just that I am unable to open multiple windows. It doesn’t seem to be an issue with pop-up blockers either as I temporarily disabled those.
Any help would be greatly appreciated.
Sincerely,
OB
Change the
typeattribute ofinputfromsubmittobutton(forinputwithname="Find"and, in fact, allinputs that you use through JavaScript exclusively, i.e. not doing a real submit to server).More details – your
formdoesn’t have anactionattribute. Take a look here:What happens in your current code when you click on “Find” button is that you are doing a submit to an unknown location. As per the standard:
this attribute is required (look at section 17.3 The FORM element).
The details in the section also explain why it redirects to “nowhere”:
So, at the end it’s up to a specific browser to decide what to do here (an implementation detail, not something you want to rely on).