ʹÓÃJavaScriptÁ¬½ÓSqlServerÊý¾Ý¿â¡£Ö´ÐÐCRUD²Ù×÷¡£
function db()
{
//»î¶¯±àºÅ
var activeid = Request.Form("activeid");
//̞
var username = Request.Form("username");
//ÊÖ»úºÅÂë
var mobile = Request.Form("mobile");
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
var userid = getUserIdByName(username);
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "insert into user (activeid,userid,chrtel,dtappenddate) values("+activeid+","+userid+",'"+mobile+"',getdate())";
rs.open(sql,conn);
rs.close();
conn.close();
rs=null;
conn=null;
}
function getUserIdByName(username)
{
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select userid from RegUsers where chrname='"+username+"'";
rs.open(sql,conn);
if(!rs.EOF)
{
return rs("userid");
}
rs.close();
conn.close();
rs=null;
conn=null;
}
function baoming()
{
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select userid,activeid,chrtel,CONVERT(varchar(30),dtappenddate,20) as dtappenddate from baoming order by id desc";
rs.open(sql,conn);
var i =1;
while(!rs.EOF && i<31)
{
Response.Write("<tr align='center'>");
Response.Write("<td>"+i +"</td>");
Response.Write("<td>"+ getUserNameById(rs('userid')) +"</td>");
Response.Write("<td>"+ getActi
Ïà¹ØÎĵµ£º
phpÖеÄevalºÍJavaScriptÖеÄevalÇø±ð£º
Definition and Usage
¶¨ÒåºÍÓ÷¨
The eval() function evaluates a
string as PHP code.
eval()º¯ÊýµÄ×÷ÓÃÊÇ£º·µ»ØÓëPHP´úÂëÏà¶ÔÓ¦µÄ×Ö·û´®¡£
The string
must be valid PHP code and must end with semicolon.
Õâ¸ö×Ö·û´®±ØÐëÊÇÓÐЧµÄPHP´úÂ룬
²¢ÇÒ±ØÐëÒԷֺŽáÊø¡ ......
// µ÷ÓÃÒ³ÃæµÄˢз½·¨
IHTMLWindow2* pWindow;
IHTMLDocument2* pDocument;
HRESULT hr = GetDHtmlDocument(&pDocument);
hr = pDocument->get_pa ......
J
SON £¨JavaScript Object Notation£©Ò»ÖÖ¼òµ¥µÄÊý¾Ý¸ñʽ£¬±Èxml¸üÇáÇÉ¡£ JSON ÊÇ JavaScript ÔÉú¸ñʽ£¬ÕâÒâζ×ÅÔÚ JavaScript Öд¦Àí JSON Êý¾Ý²»ÐèÒªÈκÎÌØÊâµÄ API »ò¹¤¾ß°ü¡£
JSONµÄ¹æÔòºÜ¼òµ¥£º ¶ÔÏóÊÇÒ»¸öÎÞÐòµÄ“‘Ãû³Æ/Öµ’¶Ô”¼¯ºÏ¡£Ò»¸ö¶ÔÏóÒÔ“{”£¨×óÀ¨ºÅ£©¿ªÊ¼£¬“ ......