Click here to Skip to main content
12,511,882 members (43,581 online)

JavaScript

 
AnswerRe: How do I hide a column using JQuery? Pin
walterhevedeich8-May-13 1:03
memberwalterhevedeich8-May-13 1:03 
GeneralRe: How do I hide a column using JQuery? Pin
AshwiniRS8-May-13 2:07
groupAshwiniRS8-May-13 2:07 
GeneralRe: How do I hide a column using JQuery? Pin
Manfred R. Bihy8-May-13 2:30
professionalManfred R. Bihy8-May-13 2:30 
GeneralRe: How do I hide a column using JQuery? Pin
AshwiniRS8-May-13 20:34
groupAshwiniRS8-May-13 20:34 
AnswerRe: How do I hide a column using JQuery? Pin
Dennis E White8-May-13 4:37
memberDennis E White8-May-13 4:37 
GeneralRe: How do I hide a column using JQuery? Pin
Jasmine25018-May-13 7:50
memberJasmine25018-May-13 7:50 
GeneralRe: How do I hide a column using JQuery? Pin
AspDotNetDev8-May-13 8:17
protectorAspDotNetDev8-May-13 8:17 
GeneralRe: How do I hide a column using JQuery? Pin
Jasmine25018-May-13 8:42
memberJasmine25018-May-13 8:42 
GeneralRe: How do I hide a column using JQuery? Pin
Ilan Firsov8-May-13 19:51
memberIlan Firsov8-May-13 19:51 
QuestionHTML Table to Export To Excel Pin
shreeniwas kushwah6-May-13 20:06
membershreeniwas kushwah6-May-13 20:06 
AnswerRe: HTML Table to Export To Excel Pin
Dennis E White7-May-13 5:18
memberDennis E White7-May-13 5:18 
QuestionCode translate from AS to Delphi Pin
isaev.mail6-May-13 0:28
memberisaev.mail6-May-13 0:28 
AnswerRe: Code translate from AS to Delphi Pin
isaev.mail12-May-13 21:12
memberisaev.mail12-May-13 21:12 
QuestionUsing this.id Pin
ASPnoob5-May-13 7:40
memberASPnoob5-May-13 7:40 
Hi all,
I am trying to pass the value inside of "this.id" from one function to another function but it's not working. Basically I am trying to grab the id of a thumbnail image which is inside anchor tags, by using "this.id" when they are clicked. Then I would like to display data related to the clicked thumbnail which are stored in an array, using innerHTML. I am using the AddEventListener property inside the script tags to listen for the onclick event thus I do not have the onclick property on my webpage. The following are my functions inside the script tags:
var songTitle =new Array("Title1", "Title2");
  function AddListeners()
    {
     if(window.addEventListener)
      {
       document.getElementById('A1').AddEventListener("click",Display_Info,false);
       document.getElementById('A2').AddEventListener("click",Display_Info,false);
       document.getElementById('A3').AddEventListener("click",Display_Info,false);
      }
     else if(window.attachEvent)
      {
       document.getElementById('A1').attachEvent("onclick",Display_Info);
       document.getElementById('A2').attachEvent("onclick",Display_Info);
       document.getElementById('A3').attachEvent("onclick",Display_Info);
      }
     }      
 
      function imgClicked(x)
      {
          var idClicked = x; //get thumbnail id      
          var newID = idClicked.substring(0,1); //subtract first character of thumbnail id        
          var convertedID = ParseInt(newID,10); //convert id to integer         
          return convertedID;          
      }
   
      function Display_Info()//passing in Parameter            
      {                 
          var A= this.id;
          var picID = imgClicked(A);
          document.getElementById('Title').innerHTML= songName[picID];                  
      }   
The following are anchor tags inside the body of my webpage:
<a href="#self"><img src=image1" id="A0"></a>
<a href="#self"><img src=image2" id="A1"></a>
<a href="#self"><img src=image3" id="A2"></a>
Please take a look to see why my script is not working. Any help is greatly appreciated, thanks in advance.
AnswerRe: Using this.id Pin
twseitex5-May-13 7:49
membertwseitex5-May-13 7:49 
GeneralRe: Using this.id Pin
ASPnoob5-May-13 8:01
memberASPnoob5-May-13 8:01 
AnswerRe: Using this.id Pin
dusty_dex6-May-13 8:26
memberdusty_dex6-May-13 8:26 
QuestionSend data with XMLHttpRequest Pin
Mohamad Hoosein Fakhravary3-May-13 22:40
memberMohamad Hoosein Fakhravary3-May-13 22:40 
QuestionRe: Send data with XMLHttpRequest Pin
Sandeep Mewara4-May-13 0:50
mvpSandeep Mewara4-May-13 0:50 
AnswerRe: Send data with XMLHttpRequest Pin
Mohamad Hoosein Fakhravary4-May-13 11:08
memberMohamad Hoosein Fakhravary4-May-13 11:08 
NewsForm builder using jQueryUI and Bootstrap Pin
Anup Shinde3-May-13 2:10
memberAnup Shinde3-May-13 2:10 
GeneralRe: Form builder using jQueryUI and Bootstrap Pin
dusty_dex3-May-13 4:56
memberdusty_dex3-May-13 4:56 
GeneralRe: Form builder using jQueryUI and Bootstrap Pin
Anup Shinde3-May-13 5:05
memberAnup Shinde3-May-13 5:05 
GeneralRe: Form builder using jQueryUI and Bootstrap Pin
Anup Shinde3-May-13 5:06
memberAnup Shinde3-May-13 5:06 
GeneralRe: Form builder using jQueryUI and Bootstrap Pin
Dennis E White3-May-13 5:59
memberDennis E White3-May-13 5:59 
Questionloading image before loading video on page Pin
meena mehra30-Apr-13 2:17
membermeena mehra30-Apr-13 2:17 
AnswerRe: loading image before loading video on page Pin
twseitex5-May-13 7:59
membertwseitex5-May-13 7:59 
QuestionI cant download the source code in the following projet Pin
Baturay E.H.AHMAD27-Apr-13 9:17
memberBaturay E.H.AHMAD27-Apr-13 9:17 
AnswerRe: I cant download the source code in the following projet Pin
ThePhantomUpvoter27-Apr-13 12:03
memberThePhantomUpvoter27-Apr-13 12:03 
QuestionjQuery Question Pin
BobInNJ26-Apr-13 13:05
memberBobInNJ26-Apr-13 13:05 
AnswerRe: jQuery Question Pin
dusty_dex26-Apr-13 13:28
memberdusty_dex26-Apr-13 13:28 
GeneralRe: jQuery Question Pin
Richard Deeming29-Apr-13 2:31
professionalRichard Deeming29-Apr-13 2:31 
GeneralRe: jQuery Question Pin
dusty_dex29-Apr-13 3:28
memberdusty_dex29-Apr-13 3:28 
GeneralRe: jQuery Question Pin
Jasmine25011-May-13 8:27
memberJasmine25011-May-13 8:27 
AnswerRe: jQuery Question Pin
Richard MacCutchan26-Apr-13 22:32
mvpRichard MacCutchan26-Apr-13 22:32 
AnswerRe: jQuery Question Pin
Graham Breach26-Apr-13 23:00
memberGraham Breach26-Apr-13 23:00 
AnswerRe: jQuery Question Pin
Member 5654516-May-13 0:44
memberMember 5654516-May-13 0:44 
QuestionMessage Automatically Removed Pin
26-Apr-13 2:23
memberHakan Bulut26-Apr-13 2:23 
QuestionJS Question Pin
Hakan Bulut18-Apr-13 3:31
memberHakan Bulut18-Apr-13 3:31 
AnswerRe: JS Question Pin
Sandeep Mewara18-Apr-13 4:55
mvpSandeep Mewara18-Apr-13 4:55 
GeneralRe: JS Question Pin
Hakan Bulut18-Apr-13 6:52
memberHakan Bulut18-Apr-13 6:52 
AnswerRe: JS Question Pin
dusty_dex18-Apr-13 6:18
memberdusty_dex18-Apr-13 6:18 
AnswerRe: JS Question Pin
Dennis E White18-Apr-13 7:34
memberDennis E White18-Apr-13 7:34 
GeneralRe: JS Question Pin
dusty_dex18-Apr-13 7:42
memberdusty_dex18-Apr-13 7:42 
GeneralRe: JS Question Pin
Hakan Bulut19-Apr-13 2:32
memberHakan Bulut19-Apr-13 2:32 
AnswerRe: JS Question Pin
dusty_dex18-Apr-13 7:41
memberdusty_dex18-Apr-13 7:41 
GeneralRe: JS Question Pin
Hakan Bulut18-Apr-13 20:59
memberHakan Bulut18-Apr-13 20:59 
GeneralRe: JS Question Pin
dusty_dex18-Apr-13 21:36
memberdusty_dex18-Apr-13 21:36 
GeneralRe: JS Question Pin
Hakan Bulut18-Apr-13 22:10
memberHakan Bulut18-Apr-13 22:10 
GeneralRe: JS Question Pin
dusty_dex18-Apr-13 22:14
memberdusty_dex18-Apr-13 22:14 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 28 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid