When i have to use single quote (' ') in scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 02:30 AM
Hello Team,
I am really Confused when i have to exactly use Single quote (' ') in scripts.
like in client script if i don't use single quote with g_form Api's then the script will not work. But with g_user Api's if I don't use single quote then the scripts work perfectly.
Will anyone help me in clearing this confusion?
Also,please find my script attached below.
Thnaks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 04:09 AM
Hi @Ankit Kumar6 ,
general JavaScript it shouldn’t matter if you use single or double quotes, you just need to be consisted. Furthermore, if there is single quote in a text string, then it will disrupt your script, hence double quotes would be the way to go.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 12:08 AM
Hi @AndersBGS
You are correct but my question is different.
My question is like when we are comparing value in if condition when we have to use single quotes and when we don't have to use.
Thanks,
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 07:56 AM
I'm sure you know not to do this, but - are you copying quotes in from somewhere else, such as MS Word?