ive been trying to fix this for a few houers, i cannot seem to do it successfully, here is my JS
var obj = {
method: 'feed',
link: 'http://www.myDomain.com/words/?w=<?php echo urlencode($facebookNoEscape['searchWord']) ?>',
picture: 'http://www.myDomain.com/actions/image.php?img=<?php echo urlencode($image_word) ?>&dir=thumbs',
name: '<?php echo $facebookNoEscape['word'] ?>',
caption: 'Author: <?php echo $facebookNoEscape['nickname']?>',
description: '<?php echo $facebookNoEscape['definition']?>'
};
NOTE: the values can contain "/ or '/ since i allow both in the insertion process, and they get escaped by mysqli_real_escape_string in the insertion process.
As you see, i echo the values which are from my MySQL DB, in to the object, now the result is this
SyntaxError: unterminated string literal
description: 'Well, personal favorite in the following order.
all.js (line 27, col 15)
the string starts with a '
I have tried to json_encode, and that partialy works, i dont encunter the issue, but, i cannot use image links like:
'http://www.myDomain.com/actions/image.php?img=<?php echo urlencode($image_word) ?>&dir=thumbs'
which results in something like:
http://www.myDomain.com/actions/image.php?img="someImage"&dir=thumbs
notice the "someImage" brackets are not supposed to be there.
And all other echoed words are enclosed by "".
Any suggestions ?
EDIT: The output
var obj = {
method: 'feed',
link: 'http://www.funkydictionary.com/words/?w=facebook%3D1',
picture: 'http://www.funkydictionary.com/actions/image.php?img=FunkyDictionary- Facebook1-image.jpg&dir=thumbs',
name: 'Facebook',
caption: 'Author: bill',
description: 'Well, personal favorite in the following order.
1. A stalkers dream come true
2. The reason most work are never done on time.
last line is broken with something, and then it flows over