Grow your CSS skills. Land your dream job.

Load local scripts. Why does this feel so ugly to me??

  • # February 25, 2013 at 11:32 pm

    Howdy folks,

    Been away from the computer for LONG while now. Starting to get back in the grove and im helping a buddy out with one of his projects. Heres the deal:

    How i normally test and load jQuery

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script>window.jQuery || document.write(unescape("%3Cscript src='js/jquery-1.9.1.min.js'%3E%3C/script%3E"))</script>

    Well, i wanted to do the same thing for a the validation plugin but my result just feels so UGLY and I cant shake why. It works and isnt killing performance, i just feel that im doing it wrong.

    Test and local load jQuery Validate

    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/jquery.validate.min.js"></script>
    <script>window.jQuery.fn.validate || document.write(unescape("%3Cscript src='js/jquery.validate-1.11.0.min.js'%3E%3C/script%3E"));</script>

    I will totally check out yalls feedback.

    # February 26, 2013 at 1:15 am

    I would only check if jQuery is cached by browser. The validate fn probably wouldn’t be, so I would just load it locally and not worry to much about it.

    # February 26, 2013 at 1:19 am

    @AlenAbdula : Yeah, you’re right. I’m pretty sure i’m over thinking things again lol. Thanks for the swift slap in face of truth…

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".