Click here to Skip to main content
15,887,427 members
Home / Discussions / JavaScript
   

JavaScript

 
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 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 21:36
professionalSuraj Sahoo | Coding Passion16-Apr-14 21:36 
QuestionGridview fixed header and footer while scrolling Pin
harsha714-Apr-14 4:09
harsha714-Apr-14 4:09 
AnswerRe: Gridview fixed header and footer while scrolling Pin
Anurag Gandhi24-Apr-14 5:29
professionalAnurag Gandhi24-Apr-14 5:29 
AnswerRe: Gridview fixed header and footer while scrolling Pin
sankarsan parida12-May-14 7:23
professionalsankarsan parida12-May-14 7:23 
Questionselecation of image with user prefrence Pin
Member 107387389-Apr-14 23:01
Member 107387389-Apr-14 23:01 
AnswerRe: selecation of image with user prefrence Pin
Tom Marvolo Riddle10-Apr-14 2:55
professionalTom Marvolo Riddle10-Apr-14 2:55 
QuestionRe: selecation of image with user prefrence Pin
ZurdoDev11-Apr-14 6:59
professionalZurdoDev11-Apr-14 6:59 
QuestionPlease help me to transfer data between elements in a web form. Pin Pin
lersmethasakul9-Apr-14 13:10
lersmethasakul9-Apr-14 13:10 
AnswerRe: Please help me to transfer data between elements in a web form. Pin Pin
Richard MacCutchan9-Apr-14 23:32
mveRichard MacCutchan9-Apr-14 23:32 
QuestionRe: Please help me to transfer data between elements in a web form. Pin Pin
ZurdoDev10-Apr-14 1:52
professionalZurdoDev10-Apr-14 1:52 
QuestionDrag and drop database related items Pin
tinaclement9-Apr-14 3:04
tinaclement9-Apr-14 3:04 
AnswerRe: Drag and drop database related items Pin
ZurdoDev10-Apr-14 1:53
professionalZurdoDev10-Apr-14 1:53 
QuestionGet ID of Clicked Object in Iframe Using JQuery Pin
RebornProgrammer8-Apr-14 17:38
RebornProgrammer8-Apr-14 17:38 
SuggestionRe: Get ID of Clicked Object in Iframe Using JQuery Pin
ZurdoDev10-Apr-14 1:55
professionalZurdoDev10-Apr-14 1:55 

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.