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


Groups > comp.lang.javascript > #22779

Re: Javascript conflicts

Newsgroups comp.lang.javascript
Subject Re: Javascript conflicts
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <deee7c09-9d64-4b16-a668-bdb8dc747c80@googlegroups.com>
Date 2014-01-25 00:03 +0100
Message-ID <XnsA2C0A13396Beejj99@194.109.133.133> (permalink)

Show all headers | View raw


WanWan <jippijappo@hotmail.com> wrote on 24 jan 2014 in
comp.lang.javascript: 

> How do I solve this?
> My script is intended to be inserted like this:
> 
> <script type="text/javascript" id="id1">var myId="id1";</script>
> <script type="text/javascript" src="myScript.js"></script>
> 
> then another place on the page:
> 
> <script type="text/javascript" id="id2">var myId="id2";</script>
> <script type="text/javascript" src="myScript.js"></script>
> 
> and so on.
> Where and how many times I cannot control. And where the script is,
> indicates where the "action" should happen. 
> 
> The problem here is that the the "unique identifier" (id1, id2 ...) for
> each script written to the same variable, so it gets the value that is
> set at last before the script runs several times. 

Why is that a problem?

Why would you need to id the <script>?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Thread

Javascript conflicts WanWan <jippijappo@hotmail.com> - 2014-01-24 14:58 -0800
  Re: Javascript conflicts "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-25 00:03 +0100
  Re: Javascript conflicts Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-24 23:09 +0000
    Re: Javascript conflicts WanWan <jippijappo@hotmail.com> - 2014-01-25 13:40 -0800

csiph-web