haku87 Posted January 19, 2008 Share Posted January 19, 2008 var test = $("#abc").html(); alert(test); //debugging purpose $.ajax({ type: "GET", url: ".././backend_php/management_php/createQuiz.php", data: "quizname="+quizname+"&category="+category+"&timelimit="+timelimit+"&instruction="+instruction, Link to comment https://forums.phpfreaks.com/topic/86743-problem-with-jquery-html-php/ Share on other sites More sharing options...
haku87 Posted January 19, 2008 Author Share Posted January 19, 2008 var test = $("#abc").html(); alert(test); //debugging purpose $.ajax({ type: "GET", url: ".././backend_php/management_php/createQuiz.php", data: "quizname="+test ........... more code .... i get the textarea text using javascript stored into a variable called test. when i alert the content in variable test. the newline character still inside However, when i passed the variable through GET (ie. "createQuiz.php?quizname= "+test the newline character disappear when i insert into database. Link to comment https://forums.phpfreaks.com/topic/86743-problem-with-jquery-html-php/#findComment-443334 Share on other sites More sharing options...
taith Posted January 19, 2008 Share Posted January 19, 2008 because the address bar itself cannot have newline characters it is stripping them out... one vital flaw with GET... if you were to send via post, you probably wouldnt have this issue... Link to comment https://forums.phpfreaks.com/topic/86743-problem-with-jquery-html-php/#findComment-443553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.