sasha85
asked on
how can asp call js function?
i mean with no user help...no links no actions...
<input type="button" value="Click Me!" onclick="getData()" />
just want add inside of some if a code that will call js function
<input type="button" value="Click Me!" onclick="getData()" />
just want add inside of some if a code that will call js function
You can only transmit data with reloading page and using querystring or by posting the data to the server (AJAX).
ASKER
you mean:
if x=y then
js1...
else
js2
end if
?
do you know where i can find a good ajax\ajaxed example that i can view its code and make some changes?
if x=y then
js1...
else
js2
end if
?
do you know where i can find a good ajax\ajaxed example that i can view its code and make some changes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what did you mean with the ajax?
somehow always when i find a nice short code of ajax on the web and i copy it to my computer
i got "ajaxed is undefined' do you know why can it be?
somehow always when i find a nice short code of ajax on the web and i copy it to my computer
i got "ajaxed is undefined' do you know why can it be?
I thought you would set data of the client javascript to asp.
If you copy Ajax-code you also need the included framework (like prototype.js). Please post another question for this with code examples!
If you copy Ajax-code you also need the included framework (like prototype.js). Please post another question for this with code examples!
<input type="button" value="Click Me!" onclick="getData()" /> change this line to
<input type="button" value="Click Me!" onclick="getData();" />
see this code Snippet
<input type="button" value="Click Me!" onclick="getData();" />
see this code Snippet
<html><title>hello js</title>
<script type="text/javascript">
function hello()
{
alert("Hello from button click");
}
</script>
<body>
<form>
<input type="button" value="CodingForums" onClick="hello();" />
</form>
</body>
<script language="javascript">
function getData() {
// js code
}
</script>
and referenced in your html <input type="button" value="Click Me!" onclick="getData()" />