Click here to Skip to main content
15,885,004 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Need help understanding this piece of code Pin
ZurdoDev17-Jul-16 8:19
professionalZurdoDev17-Jul-16 8:19 
QuestionWhat is the work of callback argument in NodeJs "module.exports"? Pin
MaxySpark4-Jul-16 10:03
MaxySpark4-Jul-16 10:03 
AnswerRe: What is the work of callback argument in NodeJs "module.exports"? Pin
rah_sin12-Jul-16 0:42
professionalrah_sin12-Jul-16 0:42 
QuestionForming your own panel Pin
Member 126139631-Jul-16 3:06
Member 126139631-Jul-16 3:06 
AnswerRe: Forming your own panel Pin
Richard MacCutchan1-Jul-16 3:48
mveRichard MacCutchan1-Jul-16 3:48 
QuestionError in parentNode.replaceChild while hiding content which is available in web page Pin
srikrishnathanthri1-Jul-16 2:41
srikrishnathanthri1-Jul-16 2:41 
QuestionChange webpage background on the fly (If it worked) Pin
Born5929-Jun-16 2:00
Born5929-Jun-16 2:00 
AnswerRe: Change webpage background on the fly (If it worked) Pin
Richard Deeming29-Jun-16 2:06
mveRichard Deeming29-Jun-16 2:06 
Well, it doesn't look good. If you check the error console, you'll see an "unterminated string literal" error, because your background path is outside of the Javascript string.

Your onload event handler also declares a nested function to set the background, but never calls it.

Change your code to:
JavaScript
window.onload = function() {
    $('#content').css('background', '#000 url(\'<%=MyBg %>\') center');
};




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


PraiseRe: Change webpage background on the fly (If it worked) Pin
Born5929-Jun-16 2:12
Born5929-Jun-16 2:12 
QuestionJSHint & Sublime use and config Pin
DavidMillar246828-Jun-16 21:00
DavidMillar246828-Jun-16 21:00 
AnswerRe: JSHint & Sublime use and config Pin
Richard MacCutchan28-Jun-16 21:20
mveRichard MacCutchan28-Jun-16 21:20 
AnswerRe: JSHint & Sublime use and config Pin
Kornfeld Eliyahu Peter28-Jun-16 22:55
professionalKornfeld Eliyahu Peter28-Jun-16 22:55 
QuestionConfirm always returning false on Firefox for IOS Ver 4.0 Pin
jkirkerx23-Jun-16 12:35
professionaljkirkerx23-Jun-16 12:35 
AnswerRe: Confirm always returning false on Firefox for IOS Ver 4.0 Pin
Graham Breach23-Jun-16 23:17
Graham Breach23-Jun-16 23:17 
GeneralRe: Confirm always returning false on Firefox for IOS Ver 4.0 Pin
jkirkerx24-Jun-16 6:10
professionaljkirkerx24-Jun-16 6:10 
GeneralRe: Confirm always returning false on Firefox for IOS Ver 4.0 Pin
Graham Breach24-Jun-16 23:54
Graham Breach24-Jun-16 23:54 
GeneralRe: Confirm always returning false on Firefox for IOS Ver 4.0 Pin
jkirkerx26-Jun-16 9:01
professionaljkirkerx26-Jun-16 9:01 
QuestionJQuery Validator, rules highlight creates label under textbox that is wrong class. Pin
jkirkerx22-Jun-16 9:34
professionaljkirkerx22-Jun-16 9:34 
AnswerRe: JQuery Validator, rules highlight creates label under textbox that is wrong class. [solved] Pin
jkirkerx22-Jun-16 12:34
professionaljkirkerx22-Jun-16 12:34 
GeneralMultidimensional Array in JavaScript Pin
HubSnippets22-Jun-16 2:05
HubSnippets22-Jun-16 2:05 
AnswerRe: Ajax succees event not firing with jsonp Pin
Peter_in_278021-Jun-16 17:23
professionalPeter_in_278021-Jun-16 17:23 
QuestionJquery Row details open Pin
Member 1130579120-Jun-16 3:31
Member 1130579120-Jun-16 3:31 
QuestionHow to compute XOR logic? Pin
AmalRaj@Sync19-Jun-16 19:05
AmalRaj@Sync19-Jun-16 19:05 
AnswerRe: How to compute XOR logic? Pin
Richard MacCutchan19-Jun-16 21:41
mveRichard MacCutchan19-Jun-16 21:41 
AnswerRe: How to compute XOR logic? Pin
Kornfeld Eliyahu Peter19-Jun-16 23:37
professionalKornfeld Eliyahu Peter19-Jun-16 23:37 

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.