Click here to Skip to main content
15,890,438 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: 2nd Javascript Assignment Pin
Afzaal Ahmad Zeeshan8-Nov-14 1:41
professionalAfzaal Ahmad Zeeshan8-Nov-14 1:41 
QuestionJavascript assignment Pin
Member 1119456830-Oct-14 18:00
Member 1119456830-Oct-14 18:00 
AnswerRe: Javascript assignment Pin
Kornfeld Eliyahu Peter30-Oct-14 20:08
professionalKornfeld Eliyahu Peter30-Oct-14 20:08 
QuestionRe: Javascript assignment Pin
ZurdoDev5-Nov-14 8:55
professionalZurdoDev5-Nov-14 8:55 
QuestionHow to get array value Pin
Nishant.Chauhan8028-Oct-14 19:11
Nishant.Chauhan8028-Oct-14 19:11 
GeneralRe: How to get array value Pin
jkirkerx29-Oct-14 12:11
professionaljkirkerx29-Oct-14 12:11 
QuestionSelect2 Newline is created when item is selected Pin
Sander123432127-Oct-14 3:31
Sander123432127-Oct-14 3:31 
QuestionClick function not working the first time Pin
KokDavy27-Oct-14 1:43
KokDavy27-Oct-14 1:43 
Hi I have same image in my page with same class $(.'cross') several times. When I click to get the ID of the clicked one, it does not work for the first time but it works one the second click.

I am using Gridster and my html is built dynamically on DOM Load like this with local variables.


gridster.add_widget.apply(gridster, ['<li id="li' + Grid.GridID + '" itemid="' + Grid.GridID + '" class="gs-w" data-row="' + Grid.GriddataRow + '" data-col="' + Grid.GriddataCol + '">Report id :' + Grid.GridItemid + '<table data-role="table" id="table' + Grid.GridID + '" class="icon"><tr><td><img id="cross' + Grid.GridID + '" class="cross" height="10" width="10" src="../images/Icones/cross.gif" alt="cross' + Grid.GridID + '" onclick="CloseGrid();" /></td><td><;img id="icon' + Grid.GridID + '" class="menu" height="10" width="10" src="../images/tbordmenuicon.png" alt="icon' + Grid.GridID + '" onclick="showMenu(event);GetClickedIcon();" /></td></tr></table><div id="container' + Grid.GridID + '" style="width:100%;height:100%;margin: 0 auto"></div></li>', Grid.GriddataX, Grid.GriddataY]);

And my closeGrid () function looks like this:


C#
function CloseGrid() {
                    $('.cross').click(function() {
                       var id = $(this).attr('id').replace('cross', '');
                                                alert(id);
                                          if (confirm("Voulez-vous définitivement supprimer ce graphique?")) {
                                                   gridster.remove_widget($('#li' + id), false);
                                                    DeleteChart(id);
 }
                                              else {
                                                    return false;

                                                }

                    });

                }



Could you please check and tell me what I am doing wrong?

I checked same forums about it but I could not find the problem.

Thanks in advance.
Questionjavascript certification study pal Pin
Member 1117229022-Oct-14 3:13
Member 1117229022-Oct-14 3:13 
QuestionJQGrid and MIT license Pin
Sibeesh KV9-Oct-14 19:20
professionalSibeesh KV9-Oct-14 19:20 
AnswerRe: JQGrid and MIT license Pin
Richard Deeming9-Oct-14 22:52
mveRichard Deeming9-Oct-14 22:52 
GeneralRe: JQGrid and MIT license Pin
Sibeesh KV12-Oct-14 23:40
professionalSibeesh KV12-Oct-14 23:40 
AnswerRe: JQGrid and MIT license Pin
Sunasara Imdadhusen12-Oct-14 23:32
professionalSunasara Imdadhusen12-Oct-14 23:32 
GeneralRe: JQGrid and MIT license Pin
Sibeesh KV12-Oct-14 23:40
professionalSibeesh KV12-Oct-14 23:40 
Questiondropdown edit type selection to read mode for few records. Pin
parkway9-Oct-14 7:06
parkway9-Oct-14 7:06 
QuestionCross domain SOAP call (with XmlHttpRequest) to a webservice with windows authentication Pin
michielke8-Oct-14 22:12
michielke8-Oct-14 22:12 
Questionhow to display timer starting from 0 minutes and increment further Pin
Member 105573645-Oct-14 1:08
Member 105573645-Oct-14 1:08 
SuggestionRe: how to display timer starting from 0 minutes and increment further Pin
Kornfeld Eliyahu Peter5-Oct-14 1:15
professionalKornfeld Eliyahu Peter5-Oct-14 1:15 
QuestionJavascript and arrays Pin
Member 1111635128-Sep-14 16:32
Member 1111635128-Sep-14 16:32 
SuggestionRe: Javascript and arrays Pin
Kornfeld Eliyahu Peter28-Sep-14 20:58
professionalKornfeld Eliyahu Peter28-Sep-14 20:58 
QuestionJavascript and arrays Pin
Member 1111635128-Sep-14 16:30
Member 1111635128-Sep-14 16:30 
AnswerRe: Javascript and arrays Pin
Kornfeld Eliyahu Peter28-Sep-14 21:00
professionalKornfeld Eliyahu Peter28-Sep-14 21:00 
AnswerRe: Javascript and arrays Pin
Richard MacCutchan28-Sep-14 22:07
mveRichard MacCutchan28-Sep-14 22:07 
GeneralRe: Javascript and arrays Pin
Sunasara Imdadhusen12-Oct-14 23:34
professionalSunasara Imdadhusen12-Oct-14 23:34 
Questionckeditor, custom dialog, element ID's are different from Firefox and IE Pin
jkirkerx24-Sep-14 10:28
professionaljkirkerx24-Sep-14 10:28 

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.