Click here to Skip to main content
11,927,167 members (49,748 online)
Rate this:
Please Sign up or sign in to vote.
The below coding works well in IE. I also need to work this code in safari.

function Transmit_SOAP()
{//For IE Browsers. This coding works well in IE browsers
var tempNode=xmlSoapTemplate.selectSingleNode(pathString+"xmlDatasets");
{//verify the code below.(Safari Support)
var tempNode=xmlSoapTemplate.evaluate(pathString+"xmlDatasets", xmlSoapTemplate, null, XPathResult.ANY_TYPE,null);
catch (e)

Kindly verify the safari code. The code execution breaks after showing the alert("Checking");

This is the error when using try catch
TypeError: Value undefined (result of expression xmlSoapTemplate.evaluate) is not object

The below code is xmlSoapTemplate
//For IE Support.
//Begin by loading up the dataform via soap request
xmlSoapTemplate=new ActiveXObject("Microsoft.XMLDOM");
xmlSoapTemplate.onreadystatechange = function () {
if (xmlSoapTemplate.readyState == 4) Transmit_SOAP()
// For Safari Support
 xmlSoapTemplate = new XMLHttpRequest();'GET','../Dataforms/soap_1.xml', true);
 xmlSoapTemplate.onreadystatechange = function() {
 if (xmlSoapTemplate.readyState == 4) {
Posted 21-Feb-13 1:58am
Edited 21-Feb-13 3:00am
Ed Nutting 21-Feb-13 7:30am
What were you trying to do? Can we see the complete code? (Since there are a lot of variables without any indication of what content they contain...) Any exception messages? Have you tried wrapping it in a try-catch(exception) block and reading the exception message? Have you used the built-in Safari debugger? Have you Google'd what are trying to do to see if anyone else has solved whatever issue(s) you are having?

There are too many unknowns for this question to be answerable. Please use the "Improve question" link above to update your question.

Mohan1984 21-Feb-13 7:59am
Improved my question. Kindly verify.
Ed Nutting 21-Feb-13 8:12am
Much improved :) I now have at least some idea what your code is trying to do (and how :) ). Next step is to find out what it thinks is 'undefined'. Try opening the code in the Safari debugger and pause on the line that's giving you the error. Then check the values of all the inputs to the method (i.e. pathString, xmlSoapTemplate) - check to see if they are undefined. Also, search the web a bit and check that this is possible - you may need to convert the data that comes from the XMLHttpRequest into a proper XMLDocument (or XMLElement) which the request object is not. Essentially, I don't think the "evaluate" method exists on the XMLHttpRequest object. Search Google for how to convert XMLHttpRequest to XMLDocument then use the same code as you have but with the XMLDocument in place of xmlSoapTemplate for your parse code (not the request code - that can stay the same :) ).

Hope this helps,
Mohan1984 21-Feb-13 8:31am
/// In Safari and IE it shows-->soap:Envelope/soap:Body/Update_DatasetsWiz/xmlDatasets

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

void compatibility()
        if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
paste this code on page load event

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100