OK, so I am pulling some text from a PHP variable to insert into a Javascript alert box. I want to be able to designate line breaks but I am having trouble. Instead of inserting a line break as "\n" in the javascript code, it just inserts a line break in the actual code.
Here's some php code:
PHP Code:
= "Line 1nLine 2";
Here is how the code looks on the page:
Code:
var alertmessage = '<?php echo ; ?>';
alert ('alertmessage');
Once the page loads, the code looks like this:
Code:
var alertmessage = 'Line 1
Line 2';
alert ('alertmessage');
I want it to look like this:
Code:
var alertmessage = 'Line 1nLine 2';
alert ('alertmessage');
Works for Anybody, Any niche - It's so simple you'll wonder why everyone isn't using it
Click Here Now to Download It!