Hi,
I would like to load scriptaculous.js after someone clicks on a link.
I have tried to use
<head>
<script type="text/javascript" src="javascript/prototype.js"></script>
<script type="text/javascript">
<!--
function loadContent(file){
var head = document.getElementsByTagName('head').item(0)
var scriptTag = document.getElementById('loadScript');
if(scriptTag) head.removeChild(scriptTag);
script = document.createElement('script');
script.src = file;
script.type = 'text/javascript';
script.id = 'loadScript';
head.appendChild(script)
}
//-->
</script>
</head>
and on page
<a href="javascript: loadContent('javascript/
scriptaculous.js');">test</a>
but It created a lot of errors like that prototype does not exist
etc.. and i did not work.
Can you help me please? I do not want to load scriptaculous on page
load since it is quite big...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---