Passion/My Idea

Javascript 관련 코드들

sunshout 2014. 6. 9. 16:17

Javascript에서 get parameter를 분리하는 방법


var queryDict = {}

location.search.substr(1).split("&").forEach(function(item) {queryDict[item.split("=")[0]] = item.split("=")[1]})



Javascript에서 string 관련 변환

http://www.w3schools.com/js/js_strings.asp



Javascript Http Get request

function httpGet(theUrl)
{
    var xmlHttp = null;

    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false );
    xmlHttp.send( null );
    return xmlHttp.responseText;
}