asp.net - Call a javascript function (in ASPX) page from a javascript file -
i have javascript file (viewer.js) situated in scripts/viewer.js default.aspx has javascript functions calls c# function in default.aspx.cs ( sends http webrequest)
now want call viewer.js function in default.aspx calls c# function.
how can handle in viewer.js?
i need because work 3d objects , select event on viewer.js
when select 3d object needs call function in default.aspx...
scripts/viewer.js
function clickpickitem(item) { $("#properties").show(); /*call function app() */ }
default.aspx
function app() { pagemethods.connect(callback); }
default.aspx.cs
[webmethod] public static string connect() { string rsp = digestauthfixer.grabresponse("http://<username>:<password>@nextbus.mxdata.co.uk/nextbuses/1.0/1"); ... code make httpwebrequest }
sorry if i'm not clear enough
i don't see option this
what need do?
thanks!
assuming viewer.js
included in default.aspx
's html, after declaration of app
:
<script type="text/javascript" src="scripts/viewer.js"></script>
you should able invoke function, assuming created within global scope (or scope of document).
function clickpickitem(item) { $("#properties").show(); app(); }
Comments
Post a Comment