I was trying to generate an HTML snippet using AJAX. From the pile of troubleshooting documents I read, I came across this trick that by adding "noscript=true" to the href attribute, the generated code will be cleaner. However, it did not say where and how nor why to use that.
Can anyone explain or elaborate on this topic? Thanks a bunch!!
Using a server-side script
The book is assuming your the server-side script will be aware of the query string and take appropriate action. In php it would look something like:
//clean generated code
May I know where did you read that from and do you know which Ajax framework/utility are you using? "
noscript=true" is not a common/standard query string (if indeed it is to be added to the end of the
href attribute as
It's more likely to be proprietary to whatever you are reading/using. You'll need to provide more info for a suitable answer.
I am quoting that paragraph:
Essentially, does that mean that with noscript=true on, the HTML page will serve only whatever is between noscript tag, and no source code will be seen?
I'm pretty sure this will not happen automatically. You would need a server-side script that looks for the ?noscript=true query string and does something when it encountered it (i.e. serve a basic page that doesn't require scripts to work)
There are probably stock scripts out there that you could use, but I don't think it's automatic.
jQuery certainly doesn't have this feature 'built-in'
.NET may have some default behviour when this is used but I doubt it
Not sure what you mean about source-code? Source-code (i.e. the underlying HTML) will always be visible to the end-user - all they have to do is choose view source in their browser and the code will be shown. There is no way to stop this or hide the code...