Phonethics
Phonethics

Reputation: 547

JQuery's getScript equivalent in Prototype

Is there some equivalent to jQuery's getScript in Prototype ?

Upvotes: 3

Views: 1361

Answers (1)

Ali Habibzadeh
Ali Habibzadeh

Reputation: 11568

var head;

var script;

head = $$('head')[0];
if (head)
{
    script = new Element('script', { type: 'text/javascript', src: 'dynamic.js' });
    head.appendChild(script);
}

Upvotes: 5

Related Questions