Beginner prototype, send a JS to accept the URL parameters of the code _prototype

Source: Internet
Author: User
<textarea id="runcode16032"><script> function Request (key) {if (typeof (This) = "undefined") return false; if (this.length>0) {var s = this.split ("&"); for (var i in s) {var sp=s[i].split (' = ') if (Sp[0]==key) return (sp[1]); return false; else return false} function Getallkey () {if (typeof (This) = "undefined") return false; var arr=new Array; if (this.length>0) {var s = this.split ("&"); for (var i in s) {var sp=s[i].split ("="); Arr.push (Sp[0]); return arr; else return false} string.prototype.request=request String.prototype.getallkey=getallkey//====================== ============================= var url=location.search.substr (1)//action=reply&forum=3&topic=1469 var arg= Url.getallkey () alert (ARG) document.write (submit parameter: +arg) for (var cou in Arg) document.write (the value of the argument "+arg[cou]+" is: "+URL.R Equest (Arg[cou]) + "") </script></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

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.