Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #26628

Re: quick question: how to dynamically an image source file?

From JJ <jj4public@vfemail.net>
Newsgroups comp.lang.javascript
Subject Re: quick question: how to dynamically an image source file?
Date 2015-01-20 07:31 +0700
Organization ?
Message-ID <1citvdfso3dg5$.jcaqtpmc522l.dlg@40tude.net> (permalink)
References (1 earlier) <XnsA427734C3E58Ceejj99@194.109.133.133> <m9iue0$bah$1@speranza.aioe.org> <6abe327d-c487-4e03-8a6f-f7f65ebc8bb0@googlegroups.com> <14epavonqlnzl.2wklfi1o8grp.dlg@40tude.net> <0b11760e-aae1-4429-bc43-1b2559d81532@googlegroups.com>

Show all headers | View raw


On Mon, 19 Jan 2015 14:24:30 -0800 (PST), justaguy wrote:
> Ok, and since I need to find if var b has been defined, so, I rewrote the code below (thought its syntax is correct).
> 
> if  ("undefined" == typeof b) {
> 	console.log("b is not defined"); 
> 	b = 0;
> 	}
> else {
> 	alert ('b is defined');
> 	}
> 
> Hence, in either case I would receive debugging info either via console (firebug is turned on) or via browser itself.  However, none.
> Which seems to suggest that the following code to run the js function has not been executed.
> // just run the function 
> f1(); 

It's still not clear where exactly the f1() function is called. Chances are
that you have error elsewhere in the code that isn't mentioned - before that
f1() function call.

> I thought, upon this page(a div) load, the js code is also processed but...
> and in case some other js code inside this js function causing problem, I
> also tried to place an alert at the start of this js function, the alert
> didn't alert.  So, it seems that this js function is simply not called.
> Question, why not?

What DIV? You did enclose you JavaScript code with SCRIPT tags, or did you
simply put the JavaScript code inside that DIV tags?

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

quick question: how to dynamically an image source file? justaguy <lichunshen84@gmail.com> - 2015-01-18 19:39 -0800
  Re: quick question: how to dynamically an image source file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-01-19 11:20 +0100
    Re: quick question: how to dynamically an image source file? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-01-19 10:48 -0200
      Re: quick question: how to dynamically an image source file? justaguy <lichunshen84@gmail.com> - 2015-01-19 07:52 -0800
        Re: quick question: how to dynamically an image source file? JJ <jj4public@vfemail.net> - 2015-01-20 02:47 +0700
          Re: quick question: how to dynamically an image source file? justaguy <lichunshen84@gmail.com> - 2015-01-19 14:24 -0800
            Re: quick question: how to dynamically an image source file? JJ <jj4public@vfemail.net> - 2015-01-20 07:31 +0700
              Re: quick question: how to dynamically an image source file? justaguy <lichunshen84@gmail.com> - 2015-01-20 02:26 -0800
            Re: quick question: how to dynamically an image source file? Tim Streater <timstreater@greenbee.net> - 2015-01-20 12:08 +0000
              Re: quick question: how to dynamically an image source file? justaguy <lichunshen84@gmail.com> - 2015-01-20 12:20 -0800
          Re: quick question: how to dynamically an image source file? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-01-20 14:06 +0100
            Re: quick question: how to dynamically an image source file? Tim Streater <timstreater@greenbee.net> - 2015-01-20 14:52 +0000
              Re: quick question: how to dynamically an image source file? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-01-20 20:47 +0100
        Re: quick question: how to dynamically an image source file? Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-19 21:15 +0000
          Re: quick question: how to dynamically an image source file? justaguy <lichunshen84@gmail.com> - 2015-01-19 14:25 -0800

csiph-web