Jump to content

Quoted Qualifiers In Js Expression


Guest Hans Wolfgang
 Share

Recommended Posts

Guest Hans Wolfgang

The first function below works fine, has been tested and debugged.The second function is supposed to produce html tags and quoted properties, and I'm becoming a bit confused. I tried to look at the x variable but it produced a blank. Likewise there was no html when viewing source of the resulting page. The second function produces six visible bullets, but no visible html source.x is supposed to be <li id="Current"><a href=...></a></li>If you could show me a sample code or create a sample for me, I would be grateful.function TabID( TabNr, LinkNr ){ if ( TabNr == LinkNr ){ return( "Current" ); } else{ return( "ddcolortabs" ); }}function NavTabs( TabNr ){ with (document) { var x = "<li id=" + TabID( TabNr, 1 ) + "><a href=...></a></li>"; writeln( "x is " + x ); writeln( "<li id=" + TabID( TabNr, 1 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 2 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 3 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 4 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 5 ) + "><a href=...></a></li>"); }}

Link to comment
Share on other sites

The first function below works fine, has been tested and debugged.The second function is supposed to produce html tags and quoted properties, and I'm becoming a bit confused. I tried to look at the x variable but it produced a blank. Likewise there was no html when viewing source of the resulting page. The second function produces six visible bullets, but no visible html source.x is supposed to be <li id="Current"><a href=...></a></li>If you could show me a sample code or create a sample for me, I would be grateful.function TabID( TabNr, LinkNr ){ if ( TabNr == LinkNr ){ return( "Current" ); } else{ return( "ddcolortabs" ); }}function NavTabs( TabNr ){ with (document) { var x = "<li id=" + TabID( TabNr, 1 ) + "><a href=...></a></li>"; writeln( "x is " + x ); writeln( "<li id=" + TabID( TabNr, 1 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 2 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 3 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 4 ) + "><a href=...></a></li>"); writeln( "<li id=" + TabID( TabNr, 5 ) + "><a href=...></a></li>"); }}
You're not putting anything between <a href=...> and </a>. There's nothing to be displayed. There are HTML tags, but no text to be shown.Try this:
var x = "<li id=" + TabID( TabNr, 1 ) + "><a href=...>Some text</a></li>";

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...