Ajax| Menu | Linkage Menu
I do the amber Unlimited level classification linkage menu JavaScript version, in the Blue Ideal and csdn published a bit, the plum blossom snow brother in Csdn put forward the problem of inefficiency, I also recognize this, this plan is completed after the completion of the project, but a moment itched, then on the internet to look for information, Finally made this Ajax version of the Unlimited class linkage menu. Because time is hurried, do more rough, but already use Ajax technology, realize infinite level linkage, after some time to perfect this version.
Hope to provide you with some help, there are good suggestions or bugs can be in this post reply or browse http://www.51ajax.com/bbs/post.
Operating Environment: MS IE 6.0 FireFox 1.0.1
Download Address: Please click here
Online Demo: Please click here
Bug Feedback: Please click here
Last Updated: 2005-10-20 16:18
A total of two files:
The file ajax.html code is as follows:
HTML code:
amber-Infinite-level linkage menu [AJAX version]
<TD height= "align=" "Left" > Download address: Please click here
<TD height= "align=" left "> Online demo: please click here
<TD height= "align=" "left" >bug feedback: Please click here
<TD height= "" align= "Left" > Last updated: 2005-10-20 16:18
<TD height= "align=" "left" > Contact way:msn:hopesoft@msn.com
<TD height= "align=" "Center" >copyright (c) "
<%
function Opendb (sdbname)
{
/*
*---------------opendb (sdbname)-----------------
* OPENDB (Sdbname)
* Function: Open database Sdbname, return conn object.
* Parameters: Sdbname, String, database name.
* Example: var conn = opendb ("Database.mdb");
*---------------opendb (sdbname)-----------------
*/
var connstr = "Provider=Microsoft.Jet.OLEDB.4.0;" Data source= "+server.mappath (sdbname);
var conn = Server.CreateObject ("ADODB.") Connection ");
Conn. Open (CONNSTR);
Return conn;
}
var oconn = opendb ("Ajax_data.mdb");
var sel = Request ("sel");
var classid = Request ("ClassID")
var fieldname = Request ("fieldname")
var arrresult = new Array ();
var sql = "Select" +fieldname+ "from Demo where parentid= '" +sel+ "' and classid= ' +classid;
var sql = "Select ID," +fieldname+ "from Demo where parentid= '" +sel+ "";
Response.Write ("Alert" ("+sql+"))
var rs = Server.CreateObject ("ADODB.") Recordset ");
Rs. Open (sql,oconn,1,1);
while (!rs. EOF)
{
Iterate through all the appropriate data into the Arrresult array.
Arrresult[arrresult.length] = rs (0). Value+ "|" +rs (1). Value;
Rs. MoveNext ();
}
Escape solved the XMLHTTP. Chinese to deal with the problem.
Array group to synthesize strings. is connected by a string of ",".
Response.Write (Arrresult.join (","));
%>
[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]
The above two versions of the program, is also a combination of many netizens wisdom, through my hand presented, the original intention of the Internet and the essence is to share, may this small program to bring you a little convenience.
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.