jking1234
asked on
Sample ASMX to return javascript
I want to place the following on a number of web pages:
<script type="text/javascript">
src="www.myserver.com/returnjs.asmx"
</script>
I want the asmx (vb.net) to return the following line
document.write('This line was produced by asmx')
<script type="text/javascript">
src="www.myserver.com/returnjs.asmx"
</script>
I want the asmx (vb.net) to return the following line
document.write('This line was produced by asmx')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That addresses your question... however.. the eval() function is dangerous as it opens up a can worms as far as security is concerned. Normal practice is to return plain simple text (as opposed to javascript) from the web service and then loading that text into other controls on the page and so on.
ASKER
MlandaT,
Thanks for the fast response.
Paragraph 3 above does the Web Services bit.
How should I amend my initial script to execute the returned string ( ie to include the eval() function?
Thanks for the fast response.
Paragraph 3 above does the Web Services bit.
How should I amend my initial script to execute the returned string ( ie to include the eval() function?
ASKER
asdf