Click here to Skip to main content
15,916,835 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionShowing blank page on IE Pin
Subin Mavunkal23-Apr-14 22:09
Subin Mavunkal23-Apr-14 22:09 
AnswerRe: Showing blank page on IE Pin
vbmike24-Apr-14 6:26
vbmike24-Apr-14 6:26 
AnswerRe: Showing blank page on IE Pin
V.25-Apr-14 2:04
professionalV.25-Apr-14 2:04 
QuestionJQPlot legend styling [SOLVED] Pin
V.22-Apr-14 21:33
professionalV.22-Apr-14 21:33 
QuestionHelp with class assignment Pin
GeraldBlackmore22-Apr-14 17:56
GeraldBlackmore22-Apr-14 17:56 
AnswerRe: Help with class assignment Pin
Peter Leow22-Apr-14 18:17
professionalPeter Leow22-Apr-14 18:17 
SuggestionRe: Help with class assignment Pin
Richard Deeming23-Apr-14 1:32
mveRichard Deeming23-Apr-14 1:32 
GeneralRe: Help with class assignment Pin
GeraldBlackmore24-Apr-14 16:37
GeraldBlackmore24-Apr-14 16:37 
AnswerRe: Help with class assignment Pin
vbmike24-Apr-14 6:12
vbmike24-Apr-14 6:12 
GeneralRe: Help with class assignment Pin
GeraldBlackmore24-Apr-14 16:38
GeraldBlackmore24-Apr-14 16:38 
Questionis it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut21-Apr-14 21:43
Hakan Bulut21-Apr-14 21:43 
AnswerRe: is it possible to get a value from another page using JavaScript language? Pin
Blikkies21-Apr-14 21:55
professionalBlikkies21-Apr-14 21:55 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut21-Apr-14 22:27
Hakan Bulut21-Apr-14 22:27 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Blikkies21-Apr-14 22:51
professionalBlikkies21-Apr-14 22:51 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut22-Apr-14 0:13
Hakan Bulut22-Apr-14 0:13 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut22-Apr-14 1:08
Hakan Bulut22-Apr-14 1:08 
QuestionRequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 9:36
professionalSuraj Sahoo | Coding Passion16-Apr-14 9:36 
AnswerRe: RequireJs Pin
ujjwal shukla16-Apr-14 20:46
ujjwal shukla16-Apr-14 20:46 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 20:59
professionalSuraj Sahoo | Coding Passion16-Apr-14 20:59 
AnswerRe: RequireJs Pin
ujjwal shukla16-Apr-14 22:36
ujjwal shukla16-Apr-14 22:36 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 22:41
professionalSuraj Sahoo | Coding Passion16-Apr-14 22:41 
GeneralRe: RequireJs Pin
Sibeesh KV24-Sep-14 18:31
professionalSibeesh KV24-Sep-14 18:31 
Yeah you can go for requireJs apart from that do this tips also.Always load scripts from CDN, if it fails you can load from your folder.
To confirm that cdn script loaded you can check for existence any variable/function this script defines, if it is undefined - then cdn failed and you need to load local script copy.

On this principle are based solutions like that:
XML
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.5.1.min.js">


So that it will be cached.

(if there is no window.jQuery property defined cdn script didn't loaded).

You may build your own solutions using this method. For instance, jquery tooltip plugin creates $.tooltip() function so we can check it with code like this:


JavaScript
if (typeof $.tooltip === 'undefined') {
       document.write('<script src="js/libs/jquery.tooltip.min.js">\x3C/script>');
   }



Read http://stackoverflow.com/questions/5257923/how-to-load-local-script-files-as-fallback-in-cases-where-cdn-are-blocked-unavai[^]

See advantages here http://www.sitepoint.com/7-reasons-to-use-a-cdn/[^]
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion24-Sep-14 19:28
professionalSuraj Sahoo | Coding Passion24-Sep-14 19:28 
GeneralRe: RequireJs Pin
Sibeesh KV24-Sep-14 21:00
professionalSibeesh KV24-Sep-14 21:00 
AnswerRe: RequireJs Pin
thatraja16-Apr-14 21:32
professionalthatraja16-Apr-14 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.