Tiddo
Tiddo

Reputation: 6524

Jquery doesn't load

For some reason jQuery won't load on my website. I've tried it in google chrome and in opera, and both browsers didn't load it. This is (part of) my code:

<script type="text/javascript" src="http://localhost:85/rgv/Scripts/CKEdit/ckeditor.js"></script>
<script type="text/javascript" scr="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">


window.onload = function()
{
// Listen to the double click event.
if ( window.addEventListener )
    document.getElementById('editPage').addEventListener( 'click', onClick, false );
else if ( window.attachEvent )
    document.getElementById('editPage').attachEvent( 'onclick', onClick );

};
function firstChild(element)
{
for (var i = 0; i < element.childNodes.length; i++)
{
    var child = element.childNodes[i];
    if (child.nodeType == 1)
    {
        return child;
    }
}
}
function onClick( ev )
{
if (typeof $ == 'undefined') {
alert('nooo');
} else {
    alert('yeah');
} 
var content = document.getElementById('innercontent');
var first = firstChild(content);
alert('hi');
var divHtml = $("#leftPanel");
alert('boo');
alert(divHtml);
var editableText = $("<textarea />");
editableText.val(divHtml);
$('#leftPanel').replaceWith(editableText);
/*for (var i = 0; i < content.childNodes.length; i++)
{
    var child = content.childNodes[i];
    if (child.nodeType == 1 && child != first)
    {
         content.removeChild(child);
    }
}*/
}

As you can see, jquery should be loaded on the second line of this script, but when the onClick function is called, It tells me that jquery isn't loaded. I've also tried downloading the jquery script to use that one, but that didn't work either. Can anyone please help me?

Upvotes: 0

Views: 776

Answers (1)

Victor Antolini
Victor Antolini

Reputation: 116

You've got 'scr' instead of 'src' when including jQuery.

Upvotes: 10

Related Questions