Select XML version of level two linkage

Source: Internet
Author: User
Tags return version
Select|xml XML file


JS file
var marketxmldoc = new ActiveXObject ("Msxml2.domdocument");
Marketxmldoc.async = false;
Marketxmldoc.load ("/xml/market_list.") XML ");
function Getmarketlist (Type)
{
var Nodes;
Switch (Type)
{
Case "Allcitys":
Nodes=marketxmldoc.getelementsbytagname ("City");
Break
Case "Allmarkets":
Nodes=marketxmldoc.getelementsbytagname ("Market");
Break
Case "Themarkets":
CITYID=ARGUMENTS[ARGUMENTS.LENGTH-1];
if (cityid!= "")
{
Nodes=marketxmldoc.selectnodes (".//city[@RecordNo = '" + Cityid + "']//market");
}
Else
{
Nodes=marketxmldoc.selectnodes (".//city//market");
}
Break
Default:
Break
}
return Nodes;
}
function Changemarkets ()
{
Cityid=event.srcelement.options[event.srcelement.selectedindex].value;
Generatemarketlist ("Themarkets", "Market", "" "," ", Cityid)
}
function Changemarketsex ()
{
Cityid=event.srcelement.options[event.srcelement.selectedindex].value;
Generatemarketlistex ("Themarkets", "_market", "" "," ", Cityid)
}
function Generatemarketlist (type,name,style,class)
{
var Olist,oitem;
var cityid=arguments[arguments.length-1];
var nodes=getmarketlist (Type,cityid);
if (nodes.length==0) return;
Switch (Type)
{
Case "Allcitys":
Case "Allmarkets":
Olist=document.createelement ("select");
Olist.style.csstext=style;
Olist.classname=class;
Olist.name=name;
Olist.id=name;
Olist.onchange= (type== "Allcitys"?) Changemarkets () ":" ");
Break
Case "Themarkets":
Olist=document.getelementsbyname (Name) [0];
Olist.innerhtml= "";
Break
Default:
Break
}
Oitem=document.createelement ("option");
Oitem.value= "";
oitem.innertext= "-Search All-";
Olist.appendchild (Oitem);
for (I=0;i {
Oitem=document.createelement ("option");
Oitem.value=nodes[i].getattribute ("Recordno");
Oitem.innertext=nodes[i].getattribute ("Name");
Olist.appendchild (Oitem);
}
return olist;
}
function inputaddress ()
{
Newvalue=event.srcelement.options[event.srcelement.selectedindex].text
document.getElementById ("Address1"). Value+=newvalue;
}
function Generatemarketlistex (type,name,style,class,callback)
{
var Olist,oitem;
var cityid=arguments[arguments.length-1];
var nodes=getmarketlist (Type,cityid);
if (nodes.length==0) return;
Switch (Type)
{
Case "Allcitys":
Case "Allmarkets":
Olist=document.createelement ("select");
Olist.style.csstext=style;
Olist.classname=class;
Olist.name=name;
Olist.id=name;
Olist.onchange= (type== "Allcitys"?) Changemarketsex (); ":" ") +callback);
Break
Case "Themarkets":
Olist=document.getelementsbyname (Na

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.