How pass variable php in javascript in function? -


Then I want the variable variable php to do javascipt function where the variable

 < Code> & lt; PHP $ code1 = ""; ? & Gt;   

For more functions

  & lt; script type = "text / javascript" & gt; Var $ code1 = $ (this); $ Txt = new array (); Var $ code1 = & lt ;? Php ek $ code1 ("code1"); ? & Gt ;; $ (Function () {$ ('go'). ('Click', function () {console.log ($ ('form'). Serialize ());}) $ ('body'). (' 'Key' ',' last ', function () {$ (' last '). Remove the clues (' last '); $ (' # ',' body '). (' <> Table & gt; & lt; Tr & gt; & lt; td & gt; & lt; input class = "last" type = "text" id = "code1" name = "code '+ (number ($ (this) .attr (' name ') Match (/ [0 -9] + / g)) '' value = "should be here" gt; & lt; / td & gt; & lt; / tr & gt; & lt; / table & gt; ');}}}})   

value should be = "$ code1" so I'll try to value value = " "But this Can I help pls?

json_encode () which you Do not want to add more quotes, but all quotes and those that are not controlled by you JSON-encoding Also, this is the easiest, if you have stuff in your javascript, you stuff your own variables.

  var data = & lt ;? Php echo json_encode ($ data); ? & Gt ;;   

In addition, I suggest that you can not add data to HTML in this way. Otherwise, there is a shortage of HTML that can cause ambiguity and injection problems.

  $ ('& lt; input & gt;'). Val (data);    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -