Hi all, I have a problem with a piece of JavaScript that I am using within a Yahoo widget. I am making a SOAP Web Services client. I need to define the end point of the service like this (and this works BTW): var http_req = new XMLHttpRequest(); http_req.open( "POST", "http://fred.bloggs.com/webservices/soap/search/Products", false ); However I don't want to hard-code the url, so I have set a variable called theSearchURL and thought I could do this: http_req.open( "POST", theSearchURL, false ); but it doesn't work (even when I surround the url string with ". Is there a problem with putting variables within commands like this? Baffling me, so any help much appreciated. Thanks, Ian. --
I don't see why this wouldn't work. Try this. var theSearchURL = 'http://fred.bloggs.com/webservices/soap/search/Products'; http_req.open( "POST", theSearchURL, false ); Code (markup): Check Firefox's error console and see what error you get.