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

calling asp from javascript

Status
Not open for further replies.

emissions

Technical User
Mar 17, 2002
68
GB
Help???
I'm trying to populate a textarea that is assembled using javascript for editor purposes, now I need to populate the textarea with information stored in a database. I have a connection and data from the database displayed on the page, just can't get it to display in the textarea/iframe ready to be edited...

code available upon request...
 
If your using javascript to generate the textbox, than it is already too late for the ASP page to put data in it, simply because the ASP page stopped executing when it finished, sent that data to your browser, then the javascript started doing it's thing.
Your options here are:
1) Output the data into a javascript variable by literally Response.Write'ing a javascript variable declaration to a script section
2) Do something AJAXy to call another ASP page that can provide the data
2a) Use XMLHTTP ActiveX object and XMLHttpRequest object for non-MS browsers to load a webpage
2b) Add a blank set of script tags into your code and use javascript to change the src attribute of that script to an ASP page that can gather tyhe data ad write it to some javascript variables, that will then be useable from your page
2c) Create an iframe or popup page to query an ASP page which will write the data to the popup as javascript variables, then have that page include a javascript call to push the data back by calling window.opener.someFunctionOnOriginalPage(dataVar)

If none of those seemt o fit your problem, more information would be needed,

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top