JavaScript static URLs How to pass the _javascript technique

Source: Internet
Author: User
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Untitled 1</title>

<body>
<div id= "Testwrap" >

</div>
<script>
function Imgclick () {
var hhj;
Hhj=document.getelementbyid ("Testimage"). getattribute ("src");
window.location= "http://www.jsjdzx.com/bbs/images/upfile/200753182445.htm?testImage=" +HHJ;
}
</script>
<a href= "Javascript:imgclick ();" onclick= "Javascript:imgclick ();" > Send picture Address </a>
</body>

Processing page:
Copy Code code as follows:

<Html>
<Head>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<Title> Example </Title>
<script>
function QueryString ()
{///construct parameter object and initialize
var name,value,i;
Var str=location.href;//gets browser address bar URL string
var num=str.indexof ("?")
STR=STR.SUBSTR (num+1)//intercept "?" The argument string that follows
var arrtmp=str.split ("&")//separating parameters to form a parameter array
For (I=0;i < arrtmp.length;i++) {
Num=arrtmp[i].indexof ("=");
if (num>0) {
Name=arrtmp[i].substring (0,num);//Get parameter name
VALUE=ARRTMP[I].SUBSTR (num+1)//Get parameter value
this[name]=value;//defines the object properties and initializes the
}
}
}
var request=new querystring ();//Create a Parameter object instance using the new operator
</script>
</Head>

<Body>
<script>
var newelement=document.createelement ("div");//Create Div Object
var str= "Picture address is:<u>" +request["Testimage"]+ "</u>"; get parameter contents with instance [field name]
NEWELEMENT.INNERHTML=STR;
Document.body.appendChild (newelement);//Add a Div object to the document
</script>

</Body>
</Html>

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.