javascript , ajax
ÎÊ:
Hi,
I have this C#/ASP.NET/.aspx page with a string variable named myString with the value "Mario Gamito".
How can I access "Mario Gamito" from within a JavaScript function, i. e., the variable's value ?
Already tried '" + mystring + "' but it doesn't works.
Any help would be appreciated.
´ð1£º
<!-- Default2.aspx -->
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function show()
{
var value=document.getElementById("Hidden1").value;
window.alert(value);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Hidden1" type="hidden" runat="server"/>
<input id="Button1" type="button" value="button" onclick="show();"/>
</div>
</form>
</body>
</html>
using System;
using System.Collections;
//Default2.aspx.cs
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web
Ïà¹ØÎĵµ£º
javaScriptÑéÖ¤Ìá½»
¿´Àý:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT=""&g ......
javascriptµÄϵͳº¯Êý
1£¬encodeURI·½·¨
·µ»Ø¶ÔÒ»¸öURI×Ö·û´®±àÂëÖеĽá¹û£¬±¾ÖÊÊÇUTF-8±àÂë
eg:
var urlStr = encodeURI('http://fanli.qq.com/index.html?a=ddd&msg=Öйú');
alert(urlStr);
2, decodeUR ......
Javascriptº¯ÊýÀàÐÍÅжÏÍêÃÀ½â¾ö·½°¸
ÔÚÅжϺ¯ÊýÀàÐÍʱ£¬ÎÒÃÇͨ³£Ê¹ÓÃtypeof·½·¨£¬Ò»°ãÇé¿öÏ£¬Ëü»áµÃµ½ÎÒÃÇËùÔ¤ÏëµÄЧ¹û¡£µ«ÊÇ£¬ÓÐһЩϸ½Ú²¢²»ÎªÎÒÃÇËùÊìÖª¡£John Resig ÔÚ·ÖÎöÁËÕâЩϸ½ÚÖ®ºó£¬ÎªÎÒÃÇÌṩÁËÒ»¸öÍêÃÀµÄ½â¾ö·½°¸£¬±¾ÎĽ«×÷Ïêϸ½éÉÜ£º
Ò»¡¢´«Í³·½·¨²»ÎªÈËËùÖªµÄϸ½Ú
ºÁÎÞÒÉÎÊ£¬ÔÚÅжϺ¯ÊýÀàÐÍʱ£¬ÎÒÃÇÊ ......
£¨1£©ÏÂÔØClientInfo.dll£¨ÔÚÎÒµÄ×ÊÔ´ÖпÉÒÔÏÂÔØhttp://download.csdn.net/source/2141582£©
£¨2£©Ê¹ÓÃnew ActiveXObject("ClientInfo.HostInfo")µ÷ÓÃActiveX¿â
£¨3£©GetAdapterMac(0)»ñÈ¡Íø¿¨MACµØÖ·
ʹÓÃʾÀý£º
<HTML>
<TITLE>ClientInfoX JavaScript Sample</TITLE>
<HEAD>
<script l ......