By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

Can't seem to get scriptalicious AJAX Request to work

P: 3
I'm having significant trouble getting the scriptalicious or dojo toolkits to work for me. For instance I'm trying to implement a simple blinddown in my page. If I were to do this:

<div id="listDiv" onclick="new Effect.BlindDown(this)">Show My Hidden Data</div>

it will work.

However if I try to move the effect like so:

<script type="text/javascript" language="javascript">
window.onload=function() {
document.getElementById("list").onclick = function(){new Effect.BlindDown(document.getElementById("listDiv" ));}
}
</script>

nada. Nothing happens. I am very confused and if anyone can help i would be much obliged!

-Jeff
Jun 23 '07 #1
Share this Question
Share on Google+
4 Replies


P: 3
I'm having significant trouble getting the scriptalicious or dojo toolkits to work for me. For instance I'm trying to implement a simple blinddown in my page. If I were to do this:

<div id="listDiv" onclick="new Effect.BlindDown(this)">Show My Hidden Data</div>

it will work.

However if I try to move the effect like so:

<script type="text/javascript" language="javascript">
window.onload=function() {
document.getElementById("listDiv").onclick = function(){new Effect.BlindDown(document.getElementById("listDiv" ));}
}
</script>

nada. Nothing happens. I am very confused and if anyone can help i would be much obliged!

-Jeff
Sorry The non working code is like this:

<script type="text/javascript" language="javascript">
window.onload=function() {
document.getElementById("listDiv").onclick = function(){new Effect.BlindDown(document.getElementById("listDiv" ));}
}
</script>
Jun 23 '07 #2

P: 3
<script type="text/javascript" language="JavaScript">
window.onload=function() {
$("list").onclick = function () {
new Ajax.Request('/servlet/ListAndDeleteBlogAjax?action=list', {method: 'get', onsucess: function(transport){$("listDiv").update(transport. responseText)}});
}
</script>

This doesn't seem to be able to do anything.

Am I using the Ajax.Request statement wrong?
Jun 23 '07 #3

pbmods
Expert 5K+
P: 5,821
Heya, spargos.

Is your code generating an error, or is it just not working?

You don't need to wait until window.onload if you know when $('list') exists. You can call that code (or include the file) at the bottom of your page (or at least, anywhere after you define the element whose ID is 'list', though some versions of Internet Explorer will generate a bizarre error if you try to include it before the very end of your body).
Jun 23 '07 #4

acoder
Expert Mod 15k+
P: 16,027
Merged threads.
Jun 25 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.