Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT help

Status
Not open for further replies.

archit

Programmer
Aug 22, 2002
19
US
Description: You are not allowed to access the document
I need to display the full string in an HTML page but the script tags make the script to get executed.


The dispaly should be

Description: You are not allowed to access the document and not

Description: You are not allowed to access the document with a pop up
 
Take the spaces out of the BOLD

You are not allowed to access the document & l t ;script& g t ;alert()

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
Thanks for the info . But there is a small problem.

Description: You are not allowed to access the document "
In this "comes from a variable and I have no control over that I simply query that variabe and put it in this HTML page. Is there a way of printing the variable w/o the script getting run ??

Any sort of help will be welcome.

Thanks in advance.
Vikul
 
create a little function that would parse the variable and search for < and > and then substitute them with & g t ; and & l t ;

something like:

function parseMe() {
holder = vAriable;
holderSub2=&quot;&quot;;
for (i=0; i<holder.length; i++) {
holderSub1=holder.substring(i,i+1);
if (holderSub1 == &quot;<&quot;) {
holderSub1=&quot;& l t ;&quot;
}
if (holderSub1 == &quot;>&quot;) {
holderSub1=&quot;& g t ;&quot;
}
holderSub2=holderSub2+holderSub1;
}
}

may need fine tuned, but....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top