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
Post a Comment