javascript - Parsing variable into .get() function -


:-)

i cannot work!

the variable "textpageid" won't work inside .get() function? how parse id in function then??

            var textpageid = $(this).attr("textpageid");         if (isopen != true) {             console.log("clicked");             $.get("@url.action("index", "upload", new { textid = textpageid })", function (data) {                 console.log(data); 

you have concatenate variable inside url using plus ( + ) signs, see below code -

note - index , upload variables? if yes, concatenate them in same way did textpageid.

var textpageid = $(this).attr("textpageid"); if (isopen != true) {      console.log("clicked");      $.get("@url.action("index", "upload", new { textid = " + textpageid + "})", function (data) {           console.log(data); 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -