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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display function value 1

Status
Not open for further replies.

A1Pat

IS-IT--Management
Jun 7, 2004
454
US
Hi all,

I'm modifying a js code and my background is ASP.

I want to print out value in a js function that I typically do in ASP is:
<%
response.write value
response.end
%>
Could someone show me how to do the same in javascript. Thanks!
 
It would be like this:

<%
response.write value
response.end
%>

Code:
document.write("<%=value%>");
document.close();

This is assuming value is a server side variable and a string, if it's a number, remove the quotes.


[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
are you sure js require <% %> in their function?
I'm just using the example to illustrate my question, I didn't mean to ask for js to display asp's value here. As a matter of fact, this is a partial of the code I'm trying to view:

Code:
strChName = IPbContentInfo.param;
		m_ch_list[m_ch_cnt] = IPbContentInfo.Channel;
        	mySDK.Channel.options[m_ch_cnt].text = strSite + strChName;
        	mySDK.Channel.options[m_ch_cnt].value = m_ch_cnt;

And I want to pre-view the strChName to understand what kind of output it provides.

Thanks!
 
This is assuming value is a server side variable and a string

It requires it IF 'value' is a server side variable.

If 'value' is declared client side, it can NOT have <% and %>

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
thank you for the help, I can view the output now. Good work!
 
Glad I could help.

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top