Quoting, editing problems
3 posters
Page 1 of 1
Quoting, editing problems
I have a code:
I can preview and submit without errors. However, when I quote or edit this post, the backslash will disappear. This causes the error to my code.
To test, try quoting this post.
- Code:
var jsCodes = "<img src=\"http://r29.imgfast.net/users/3412/19/22/63/smiles/45347.png\" />";
I can preview and submit without errors. However, when I quote or edit this post, the backslash will disappear. This causes the error to my code.
To test, try quoting this post.
Re: Quoting, editing problems
Do you exactly need those in the code?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Quoting, editing problems
I don't understand you. I'm reporting a problem in SCEditor.SLGray wrote:Do you exactly need those in the code?
Re: Quoting, editing problems
I mean that I believe you do not need the backlashes?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Quoting, editing problems
I think that is not the way to solve the problem. Because my forum is also a lot of other people who also share their code.
Re: Quoting, editing problems
The backslash "\" is commonly used in programming as an escape character. With JavaScript it can be used in string literals to use the same kind of quotation marks inside it without ending the string.
Example :
The string ended before "s", because the quotation mark was recognized as the end of the string literal. Using the escape character gets passed this problem.
Into the topic.. That's a problem, but for the moment I'd recommend using a different kind of quote for the attributes, such as the single.
or swap it :
Example :
- Code:
var str = 'Let's go to the park!'; // syntax error
The string ended before "s", because the quotation mark was recognized as the end of the string literal. Using the escape character gets passed this problem.
- Code:
var str = 'Let\'s go to the park!'; // All good :)
Into the topic.. That's a problem, but for the moment I'd recommend using a different kind of quote for the attributes, such as the single.
- Code:
var jsCodes = "<img src='http://r29.imgfast.net/users/3412/19/22/63/smiles/45347.png' />";
or swap it :
- Code:
var jsCodes = '<img src="http://r29.imgfast.net/users/3412/19/22/63/smiles/45347.png" />';
Re: Quoting, editing problems
The explanation on the backslash wasn't directed towards you.
From what I can tell, the backslash in my post didn't disappear. I'm assuming it's only with certain characters ? ( i.e. double quote ) I'm just going to leave a few test below to see.
From what I can tell, the backslash in my post didn't disappear. I'm assuming it's only with certain characters ? ( i.e. double quote ) I'm just going to leave a few test below to see.
- Code:
"<div id=\"noId\"></div>";
"A \"normal\" string.";
'<div id=\'noId\'></div>';
'A \'normal\' string.';
Re: Quoting, editing problems
Ange Tuteur wrote:The explanation on the backslash wasn't directed towards you.
From what I can tell, the backslash in my post didn't disappear. I'm assuming it's only with certain characters ? ( i.e. double quote ) I'm just going to leave a few test below to see.
- Code:
"<div id="noId"></div>";
"A "normal" string.";
'<div id=\'noId\'></div>';
'A \'normal\' string.';
Re: Quoting, editing problems
Yeah, it's only the double quote as I thought. I'll report it to see if they can do anything about it.
Similar topics
» Single quote button keeps quoting all quotes already quoted when quoting a members comments.
» Profile Editing Problems
» members post editing problems
» Questions about quoting (quotes as replies)
» Question about notifications
» Profile Editing Problems
» members post editing problems
» Questions about quoting (quotes as replies)
» Question about notifications
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum