Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2004, 04:24 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default XML and netscape / Mozilla

I am using XML in web scripts to dynamically refresh portions of web pages. For e.g. If dynamically populating one select box depending on the value chosen from another select box. I am attaching a sample JS code I am using. The idea is to submit an xml to an ASP page. The ASP page processes it and returns an XML back. This reply XML is parsed with the help of Javascript to refresh portions of web page.

function func_retrieve_fabric_types()
        {
            var str_browser=func_get_browser();
            var str_xml="";
            //alert(document.frm_test.cbo_fabric_categories.opti ons[document.frm_test.cbo_fabric_categories.selectedIn dex].value);
            if(!((document.frm_test.cbo_fabric_categories.opti ons[document.frm_test.cbo_fabric_categories.selectedIn dex].value)==""))
            {
                str_xml+="<xml_to_be_submitted><request_xml><fabri c_cat_id>"+document.frm_test.cbo_fabric_categories .options[document.frm_test.cbo_fabric_categories.selectedIn dex].value+"</fabric_cat_id></request_xml></xml_to_be_submitted>";
                if(str_browser=="IE")
                {
                    var obj_http=new ActiveXObject("Microsoft.XMLHTTP");
                }
                else if(str_browser=="NS6")
                {
                    alert("browser is NS 6 or later");
                    var obj_http=new XMLRemoteRequest();
                }
                var str_url="testfb.asp";
                var str_http_method="post";
                obj_http.open(str_http_method,str_url,false);
                obj_http.SetRequestHeader("Content-Type","application/x-www-form-urlencoded");
                obj_http.send(str_xml);
                var str_reply=obj_http.ResponseText;

                //processes return xml
                alert (str_reply);
                var xmlResponse = str_reply;
                var objXmlDOM=new ActiveXObject("Microsoft.XMLDOM");
                if(!objXmlDOM.loadXML(xmlResponse))
                {
                    alert("Could not load xml object");
                }
                else
                {
                    var i_option_id = objXmlDOM.selectNodes("/options/option_id");
                    var str_option_text = objXmlDOM.selectNodes("/options/option_text");
                    var i_loop;
                    var i_num_options=1;
                    document.frm_test.cbo_fabric_types.options.length= 1;
                    for(i_loop=0;i_loop<i_option_id.length;++i_loop)
                    {
                        document.frm_test.cbo_fabric_types.options.length+ =1;
                        i_num_options++;
                        document.frm_test.cbo_fabric_types.options[i_num_options-1].value=i_option_id[i_loop].text;
                        document.frm_test.cbo_fabric_types.options[i_num_options-1].text=str_option_text[i_loop].text;
                    }
                }
            }
        }

I am not getting the response XML back from server when the browser is netscape is 6 or 7.

This code will work only in IE (so that I have to tell the clients to use IE alone to run the intra office applications). I would like to know whether there are any similar code / technique that will make it run on netscape / mozilla ?

Thanks for reading.




Similar Threads
Thread Thread Starter Forum Replies Last Post
XML in JavaScript for Mozilla jwalborn Javascript 2 February 6th, 2008 11:47 AM
Transform XML with XSLT in JavaScript Mozilla Spankmaster79 Javascript 3 January 18th, 2006 07:31 AM
XML Javascript + Netscape equivalent sasidhar79 XML 0 October 19th, 2004 02:49 AM
XML & Netscape Greg Griffiths Javascript How-To 13 September 30th, 2004 10:20 AM
XML and netscape / mozilla madhukp XML 1 May 21st, 2004 04:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.