forked from atom/flight-manual.atom.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_data.json
3016 lines (3015 loc) · 200 KB
/
example_data.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"total": 105507,
"page": 1,
"pagesize": 100,
"questions": [
{
"tags": [
"javascript",
"jquery",
"html"
],
"answer_count": 0,
"favorite_count": 0,
"question_timeline_url": "/questions/6414827/timeline",
"question_comments_url": "/questions/6414827/comments",
"question_answers_url": "/questions/6414827/answers",
"question_id": 6414827,
"owner": {
"user_id": 807067,
"user_type": "unregistered",
"display_name": "Barcino",
"reputation": 1,
"email_hash": "a4aec9f48b0281995da5b2223b3ac213"
},
"creation_date": 1308589530,
"last_activity_date": 1308589530,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 6,
"score": 0,
"community_owned": false,
"title": "Why does my checkbox return the wrong state?",
"body": "<p>I'm really confused. I have the following:</p>\n\n<pre><code><input class=\"check-box\" \n id=\"Data__Correct\" \n name=\"Data.Correct\" \n type=\"checkbox\" value=\"Data.Correct\" />\n</code></pre>\n\n<p>When I put a check in the checkbox and check with fiddler I see it's sending back:</p>\n\n<pre><code>Data.Correct False\n</code></pre>\n\n<p>I thought it should be the other way around. What's happening?</p>\n"
},
{
"tags": [
"php",
"javascript",
"jquery",
"html",
"div"
],
"answer_count": 2,
"accepted_answer_id": 6414808,
"favorite_count": 1,
"question_timeline_url": "/questions/6414614/timeline",
"question_comments_url": "/questions/6414614/comments",
"question_answers_url": "/questions/6414614/answers",
"question_id": 6414614,
"owner": {
"user_id": 798662,
"user_type": "registered",
"display_name": "Eric",
"reputation": 161,
"email_hash": "25601fc3740f83926598cc89dc604e5f"
},
"creation_date": 1308588228,
"last_edit_date": 1308589468,
"last_activity_date": 1308589468,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 31,
"score": 0,
"community_owned": false,
"title": "Fairly easy JQuery Input Selection location problem",
"body": "<p>I am having a problem with getting my JQuery javascript code to apply to the select box elements that it is supposed to. What's happening is that the select boxes are not following the actions that are specified in the javascript code. They are simply staying disabled and checked (see code below) instead of changing based on the first checkbox's selection.</p>\n\n<p>I believe it is a problem regarding how I specify the location of the select boxes in the javascript code, but I don't know how to go about fixing it. Then again, I could be wrong about that too.</p>\n\n<p>If you have any insight on this or can correct the code, please do! Cheers.</p>\n\n<hr>\n\n<h2>HTML:</h2>\n\n<pre><code><div class=\"medium_box\">\n <form name=\"searchform\" class=\"FECKsearch\" method=\"get\" onSubmit=\"return dosearch();\">\n <input name=\"s\" id=\"searchBox\" class=\"input\" type=\"text\" value=\"\" onfocus=\"myFocusHandler(this);\" onblur=\"myBlurHandler(this);\" size=\"18\" maxlength=\"50\">\n <input type=\"submit\" name=\"searchsubmit\" class=\"button\" value=\"Go\" />\n\n <span class=\"searcher\">International: <input type=\"checkbox\" id=\"International\" checked=\"yes\"></input></span>\n <span class=\"searcher1\">Americas: <input type=\"checkbox\" id=\"Americas\" disabled checked=\"yes\"></input></span>\n <span class=\"searcher1\">Europe: <input type=\"checkbox\" id=\"Europe\" disabled checked=\"yes\"></input></span>\n Asia: <input type=\"checkbox\" id=\"Asia\" disabled checked=\"yes\"></input>\n </form> \n</div>\n</code></pre>\n\n<h2>Javascript:</h2>\n\n<pre><code>$('#International').click(function() {\nvar paramChangeBoxes = $('input:checkbox');\nif ($(this).is(':checked')) {\n $('#Americas').attr('checked', 'checked');\n $('#Americas').attr('disabled', 'disabled');\n $('#Europe').attr('checked', 'checked');\n $('#Europe').attr('disabled', 'disabled');\n $('#Asia').attr('checked', 'checked');\n $('#Asia').attr('disabled', 'disabled');\n}\nelse {\n paramChangeBoxes.removeAttr('disabled');\n $('#Americas').removeAttr('disabled');\n $('#Europe').removeAttr('disabled');\n $('#Asia').removeAttr('disabled');\n\n }\n});\n</code></pre>\n\n<hr>\n\n<h1>Update & Solution:</h1>\n\n<p>Cheers to <a href=\"http://stackoverflow.com/users/763228/john\">John</a> for the code <code>$('#International').live(\"click\",function() {</code> which corrected the error of the JQuery code not functioning. Apparently if you are importing the code from a remote file you must include the \"live\" portion inside of your coding.</p>\n\n<p>Thanks again John!</p>\n"
},
{
"tags": [
"javascript",
"jquery",
"html",
"file-upload"
],
"answer_count": 2,
"favorite_count": 0,
"bounty_closes_date": 1308660760,
"bounty_amount": 50,
"question_timeline_url": "/questions/6296451/timeline",
"question_comments_url": "/questions/6296451/comments",
"question_answers_url": "/questions/6296451/answers",
"question_id": 6296451,
"owner": {
"user_id": 393751,
"user_type": "registered",
"display_name": "ibhbuhbuhb",
"reputation": 92,
"email_hash": "2a06a2827b2baa70da6c7ac35acfcb5e"
},
"creation_date": 1307638388,
"last_edit_date": 1308056144,
"last_activity_date": 1308589363,
"up_vote_count": 7,
"down_vote_count": 0,
"view_count": 212,
"score": 7,
"community_owned": false,
"title": "problem in file upload",
"body": "<p>I have the following markup:</p>\n\n<pre><code> <select multiple=\"multiple\" id=\"targetFilesList\" style=\"width:200px;height:110px;\">\n </select>\n <input type=\"button\" value=\"Get\" id=\"btnGet\" />\n</code></pre>\n\n<p>and following javascript:</p>\n\n<pre><code> $(function()\n {\n $('#btnGet').click(function()\n {\n var fileupload = $(\"<input type='file' name='filetoupload' style='visibility:hidden;'/>\");\n $('body').append(fileupload);\n\n fileupload[0].onchange = function()\n {\n $('#targetFilesList').append('<option >' + fileupload.val() + '</option>');\n return false;\n }\n fileupload.click();\n });\n });\n</code></pre>\n\n<p>Scenario is that i have to upload multiple files and once user has chosen the file to be uploaded i have to show the file name to user.Then,on submitting the form i will upload all the files.For this,on clicking the get button i am adding a fileupload control dynamically\nand initialise onchange event of the fileupload control just added. The problem in chrome 12 on clicking get button fileupload control does not get opened but in firefox4 and ie8 it is working.\nAny idea why?</p>\n"
},
{
"tags": [
"php",
"javascript",
"facebook",
"twitter",
"share"
],
"answer_count": 0,
"favorite_count": 0,
"question_timeline_url": "/questions/6414782/timeline",
"question_comments_url": "/questions/6414782/comments",
"question_answers_url": "/questions/6414782/answers",
"question_id": 6414782,
"owner": {
"user_id": 807063,
"user_type": "unregistered",
"display_name": "ponens",
"reputation": 6,
"email_hash": "28f14a601696f114e84c5be712032c73"
},
"creation_date": 1308589336,
"last_activity_date": 1308589336,
"up_vote_count": 1,
"down_vote_count": 0,
"view_count": 3,
"score": 1,
"community_owned": false,
"title": "Provide link/Redirect after a 'Like' or 'Share' on Facebook or a 'Share' on Twitter",
"body": "<p>basically what I want to do is forward people to a download link once they either 'like' my page on Facebook or post a link of the page to their profile (whatever is easier) and something similar for Twitter.</p>\n\n<p>I have seen some bands do this when promoting a free download — to download the new song you must post this to your profile etc.</p>\n\n<p>Anybody know how I could go about this? (This isn't a 'can you do it for me' question, I just need a point in the right direction regarding API's or any examples) </p>\n\n<p>Thanks.</p>\n"
},
{
"tags": [
"javascript",
"jquery"
],
"answer_count": 8,
"accepted_answer_id": 6412781,
"favorite_count": 0,
"question_timeline_url": "/questions/6412607/timeline",
"question_comments_url": "/questions/6412607/comments",
"question_answers_url": "/questions/6412607/answers",
"question_id": 6412607,
"owner": {
"user_id": 256439,
"user_type": "registered",
"display_name": "Sandra Schlichting",
"reputation": 1327,
"email_hash": "c4b17df9c9b2f33a96eb84f92054f708"
},
"creation_date": 1308579341,
"last_edit_date": 1308586824,
"last_activity_date": 1308589242,
"up_vote_count": 2,
"down_vote_count": 0,
"view_count": 67,
"score": 2,
"community_owned": false,
"title": "Passing argument to function. What's wrong?",
"body": "<p>In this <a href=\"http://jsfiddle.net/littlesandra88/EcCTx/\" rel=\"nofollow\">jsFiddle</a></p>\n\n<p>am I trying to pass an argument to a function, but it doesn't receive the argument or it isn't executed.</p>\n\n<pre><code><a href=\"javascript:addRemove('7249');\">Details</a>\n</code></pre>\n\n<p>JQuery</p>\n\n<pre><code>$(document).ready(function() {\n\n function addRemove(u) {\n alert(u);\n }\n\n});\n</code></pre>\n\n<p>Any ideas what's wrong and how to fix it?</p>\n"
},
{
"tags": [
"c#",
"javascript",
"matlab"
],
"answer_count": 0,
"favorite_count": 0,
"question_timeline_url": "/questions/6414755/timeline",
"question_comments_url": "/questions/6414755/comments",
"question_answers_url": "/questions/6414755/answers",
"question_id": 6414755,
"owner": {
"user_id": 662770,
"user_type": "registered",
"display_name": "shahar_m",
"reputation": 291,
"email_hash": "4590affff8ab7bda7cbc2a3d766f02bd"
},
"creation_date": 1308589121,
"last_activity_date": 1308589121,
"up_vote_count": 1,
"down_vote_count": 0,
"view_count": 9,
"score": 1,
"community_owned": false,
"title": "Convert Matlab Fuzzy Logic toolbox fis file to c# / c++ / javascript",
"body": "<p>I have a Matlab program that is partially relies on Matlab's Fuzzy logic toolbox, which I want to convert to c# program (and later on to objective-c, but let's keep this for later).\nIs ther any means to convert my fuzzy logic fis file into c# (or c++, or maybe even javascript)?</p>\n\n<p>P.S. I know the <code>deploytool</code> can convert my program to exe, but I don't want to rely on <code>matlab runtime</code> component and dlls but to make it a complete c# (or c++) program.</p>\n"
},
{
"tags": [
"javascript",
"html5",
"browser",
"cross-browser"
],
"answer_count": 2,
"accepted_answer_id": 5560986,
"favorite_count": 3,
"question_timeline_url": "/questions/5306132/timeline",
"question_comments_url": "/questions/5306132/comments",
"question_answers_url": "/questions/5306132/answers",
"question_id": 5306132,
"owner": {
"user_id": 471795,
"user_type": "registered",
"display_name": "kanaka",
"reputation": 3994,
"email_hash": "b2bd81c28bcafeea19ac72e554859ec0"
},
"creation_date": 1300148053,
"last_edit_date": 1308589105,
"last_activity_date": 1308589105,
"up_vote_count": 6,
"down_vote_count": 0,
"view_count": 274,
"score": 6,
"community_owned": false,
"title": "Translate Javascript keyCode into charCode for non-U.S. keyboard layout (i.e. azerty)",
"body": "<p>Quick background:</p>\n\n<ul>\n<li>when a key is pressed in a browser, three events are generated: <strong>keyDown</strong>, <strong>keyPress</strong> and <strong>keyUp</strong>.</li>\n<li><strong>keyDown</strong> and <strong>keyUp</strong> have a <strong>keyCode</strong> property which is approximately the physical key pressed.</li>\n<li><strong>keyPress</strong> also has <strong>charCode</strong> property set which takes into account modifier keys and keyboard layout (A and a have same keyCode but a different charCode).</li>\n<li>all three events have properties that indicate which modifier keys were pressed during those events.</li>\n</ul>\n\n<p>I'm the main <a href=\"https://github.com/kanaka/noVNC\" rel=\"nofollow\">noVNC</a> developer and I have a tough problem: noVNC needs the translated <strong>charCode</strong> value without using the <strong>keyPress</strong> event for the following reasons:</p>\n\n<ul>\n<li>noVNC needs to send the keyDown and keyUp events separately to the VNC server (otherwise it's not a completely functional VNC client).</li>\n<li>more importantly, noVNC needs to prevent the default keyboard actions while connected which means calling the <strong>preventDefault()</strong> method of the <strong>keyDown</strong> event. This has the side-effect of also preventing the <strong>keyPress</strong> event from firing.</li>\n</ul>\n\n<p>Due to differences in keyboard layouts (i.e. different keyCode to charCode mappings) I've determine that noVNC will need a lookup table for different keyboard layouts.</p>\n\n<p><strong>But here is the real problem:</strong> on alternate layouts, some different physical keys have the <strong>SAME</strong> keyCode. For example, with an <strong>azerty</strong> (French) keyboard layout the '-' (dash) and '_' underscore keys both generate keyCode 189. Ack!!!</p>\n\n<p>So ... how do I get proper keyCode to charCode mapping and prevent default browser actions at the same time?</p>\n\n<p>BTW, I suspect the solution to this will be applicable to other interactive web applications and HTML5 games since you often want to be able to know full information about the key pressed without triggering any additional browser response to that keypress.</p>\n\n<p>Useful links:</p>\n\n<ul>\n<li><a href=\"http://kanaka.github.com/noVNC/noVNC/tests/keyboard.html\" rel=\"nofollow\">Here</a> is an useful test page that show the three events and some other useful properties.</li>\n<li><a href=\"http://unixpapa.com/js/key.html\" rel=\"nofollow\">Summary</a> of the crazy state of key events in Javascript (thanks @Tim)</li>\n<li>Quirksmode <a href=\"http://www.quirksmode.org/js/keys.html\" rel=\"nofollow\">Detecting keystrokes</a></li>\n<li>Quirksmode <a href=\"http://www.quirksmode.org/dom/events/tests/keys.html\" rel=\"nofollow\">Events - key events</a></li>\n<li><a href=\"https://github.com/kanaka/noVNC/issues/#issue/21\" rel=\"nofollow\">noVNC issue</a> with more discussion of the problem.</li>\n</ul>\n\n<p><strong>Solution</strong>: see my post below.</p>\n"
},
{
"tags": [
"javascript",
"ruby-on-rails"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6413951/timeline",
"question_comments_url": "/questions/6413951/comments",
"question_answers_url": "/questions/6413951/answers",
"question_id": 6413951,
"owner": {
"user_id": 51382,
"user_type": "registered",
"display_name": "willcodejavaforfood",
"reputation": 12699,
"email_hash": "d5c948086776fc91b4c7abff56bb7672"
},
"creation_date": 1308584996,
"last_activity_date": 1308588759,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 17,
"score": 0,
"community_owned": false,
"title": "How do I update my model object before a create/update?",
"body": "<p>It's me the big rails newbie. I have another problem.</p>\n\n<p>This is my partial for _care_point.html.erb</p>\n\n<pre><code><div id='<%=dom_id(care_point) %>' class='draggable node_chin'>\n <div id=<%=\"node_#{care_point.id}\" %> class='node'><%= care_point.body %>\n </div>\n <textarea class='node_input'><%= care_point.body %></textarea>\n <%= link_to 'Close', [care_map, care_point], :method => :post, :remote => true, :class => 'close' %>\n <%= link_to 'Delete', [care_map, care_point], :confirm => \"Are you sure?\", :method => :delete, :remote => true, :class => 'delete' %>\n</div>\n</code></pre>\n\n<p>When I click the Close link the request is sent to the server as expected. All the fields are null though. How do I make sure that my model object is kept updated before it is sent to the server? Do I have to use the form functionality or can I just update it with Javascript somehow?</p>\n\n<p>Cheers</p>\n"
},
{
"tags": [
"javascript",
"jquery",
"ajax",
"jquery-ajax"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6414530/timeline",
"question_comments_url": "/questions/6414530/comments",
"question_answers_url": "/questions/6414530/answers",
"question_id": 6414530,
"owner": {
"user_id": 484082,
"user_type": "registered",
"display_name": "blasteralfred",
"reputation": 505,
"email_hash": "cd867e89325fe74445707fb6b4364be8"
},
"creation_date": 1308587719,
"last_edit_date": 1308588455,
"last_activity_date": 1308588636,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 45,
"score": 0,
"community_owned": false,
"title": "Change background using Javascript - AJAX - jQuery",
"body": "<p>I have a table as below;</p>\n\n<pre><code><table style=\"width: 100%; border: solid 1px #666600; min-width: 800px\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td id=\"aaa\">&nbsp;</td>\n<td class=\"content\" >&nbsp;</td>\n<td class=\"content\" >&nbsp;</td>\n<td class=\"content\" >&nbsp;</td>\n<td class=\"content\" >&nbsp;</td>\n<td class=\"content\" >&nbsp;</td>\n<td class=\"content\" >&nbsp;</td>\n<td id=\"bbb\">&nbsp;</td>\n</tr>\n<tr>\n<td>&nbsp;</td>\n<td class=\"title\" >&nbsp;</td>\n<td class=\"title\" >&nbsp;</td>\n<td class=\"title\" >&nbsp;</td>\n<td class=\"title\" >&nbsp;</td>\n<td class=\"title\" >&nbsp;</td>\n<td class=\"title\" >&nbsp;</td>\n<td>&nbsp;</td>\n</tr>\n</table>\n</code></pre>\n\n<p>I am using jquery ajax and i have script as below;</p>\n\n<pre><code>$(document).ready( function() {\nvar i = 1;\n$.ajax({\n type: 'POST',\n url: 'ajax.php',\n data: 'id=' + i,\n dataType: 'json',\n cache: false,\n success: function(result) {\n $('.title').each(function(index){\n values = result[index].split('*');\n indexa = values[0];\n indexb = values[1];\n if((result[index])){\n $(this).html(indexb);\n }else{\n $(this).html(\"&nbsp;\");\n }\n });\n },\n });\n});\n</code></pre>\n\n<p>The php file will return <code>[\"data1*abc\",\"data2*abc\",\"data3*abc\",\"data4*abc\",\"data5*abc\",\"data6*abc\"]</code> for i=1, <code>[\"data7*abc\",\"data8*abc\",\"data9*abc\",\"data10*abc\",\"data11*abc\",\"data12*abc\"]</code> for i=2 etc etc.. The text in <code>class=\"title\"</code> changes accordingly with respect to the data, as <code>abc</code> or whatever it is..</p>\n\n<p>You can see another cell above every title cell having <code>class=\"content\"</code>. I have a php file, <code>ajax2.php</code>, which will return an image name with respect to a <code>$_POST[\"data1\"]</code> and <code>$_POST[\"data2\"]</code>. The <code>$_POST[\"data1\"]</code> portion should have value <code>indexa</code> and <code>$_POST[\"data2\"]</code> portion should have value <code>indexb</code> from javascript for each ajax request. The images are placed in images folder and the data returned by php file will be only <code>image_name.extension</code>.</p>\n\n<p>In short, I want to change the background image of content cell above title cell to change when data / text in corresponding title cell changes. Anybody tell me how to do the AJAX request and change background image (change background image url).</p>\n\n<p>I think it will be something like;</p>\n\n<p><code>$(.content).css({ 'background-image':'url(images/' + imagename });</code></p>\n\n<p>You can see my fiddle <a href=\"http://jsfiddle.net/blasteralfred/BFht7/\" rel=\"nofollow\"><strong>here</strong></a></p>\n\n<p>Thanks in advance..</p>\n"
},
{
"tags": [
"javascript"
],
"answer_count": 3,
"accepted_answer_id": 4047114,
"favorite_count": 0,
"question_timeline_url": "/questions/4047072/timeline",
"question_comments_url": "/questions/4047072/comments",
"question_answers_url": "/questions/4047072/answers",
"question_id": 4047072,
"owner": {
"user_id": 457827,
"user_type": "registered",
"display_name": "Johnson",
"reputation": 304,
"email_hash": "1ce4f00aae1dbed39c2899dbd85e4169"
},
"creation_date": 1288299036,
"last_activity_date": 1308588573,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 70,
"score": 0,
"community_owned": false,
"title": "JS: setInterval and blur.",
"body": "<p>I have this:</p>\n\n<pre><code>$(window).blur(function() {\n setInterval(function() {\n $.ajax({\n type: \"POST\",\n url: \"imback.php\",\n data: {\n mode: 'ajax',\n getUpdates: 'auto',\n },\n success: function(msg){\n document.title = msg + titleOrig;\n }\n });\n }, 35000);\n</code></pre>\n\n<p>Works fine.</p>\n\n<p>Although, if you have been blur, and then when you focus back, it will keep making the ajax call, it doesnt stop sending ajax call after interval 35 seconds. </p>\n\n<p>How can i fix this?\n })</p>\n"
},
{
"tags": [
"javascript",
"xml"
],
"answer_count": 2,
"favorite_count": 0,
"question_timeline_url": "/questions/4272538/timeline",
"question_comments_url": "/questions/4272538/comments",
"question_answers_url": "/questions/4272538/answers",
"question_id": 4272538,
"owner": {
"user_id": 519506,
"user_type": "unregistered",
"display_name": "Erin",
"reputation": 6,
"email_hash": "dcc375d4184c9ce18bedc0db1391cb2f"
},
"creation_date": 1290641828,
"last_edit_date": 1308588407,
"last_activity_date": 1308588407,
"up_vote_count": 1,
"down_vote_count": 0,
"view_count": 398,
"score": 1,
"community_owned": false,
"title": "How can I parse XML in javascript in both IE and firefox?",
"body": "<p>I'm trying to write a single piece of code to parse javascript in both IE and firefox.</p>\n\n<p>The following works in IE, and functions without complaining in firefox</p>\n\n<pre><code>function XmlDom(sXml){\n var oXml;\n if (window.ActiveXObject) {\n // ie\n oXml = new ActiveXObject(\"Microsoft.XMLDOM\");\n oXml.resolveExternals = false;\n oXml.async = false;\n oXml.loadXML(sXml);\n }\n else if (window.DOMParser){\n\n var parser = new DOMParser(); \n oXml = parser.parseFromString(sXml, \"text/xml\");\n\n }\nreturn oXml\n}\n</code></pre>\n\n<p>The following works in IE, but gives errors (because childNodes doesn't exist) under Firefox</p>\n\n<pre><code>var oXml = XmlDom(sourceXML);\nvar listHtml = \"\";\nif (oXml.firstChild != null) {\n var childNodes = null;\n try {\n childNodes = oXml.lastChild.lastChild.firstChild.childNodes;\n }\n if (childNodes != null && childNodes.length > 0) {\n\n for (var i = 0; i < childNodes.length; i++) {\n\n var vehicleName = NodeText(SelectSingleNode(childNodes[i], 'VehicleName', 'VehicleName'));\n var vehicleId = NodeText(SelectSingleNode(childNodes[i], 'VehicleId', 'VehicleId'));\n\n }\n }\n}\n</code></pre>\n\n<p>Using jquery gives me correct behavior under firefox, but doesn't quite work in IE (it finds the correct number of vehicles, but each one has a null id and name)</p>\n\n<pre><code> $(sourceXml).find(\"Table1\").each(function() {\n var vehicleId = $(this).find(\"VehicleId\").text();\n var vehicleName = $(this).find(\"VehicleName\").text();\n });\n</code></pre>\n\n<p>I firmly believe that both these approaches <em>should</em> work. But something is going wrong. I'd love a hand.</p>\n\n<pre><code><?xml version=\"1.0\" encoding=\"utf-16\"?>\n<DataSet>\n <xs:schema id=\"NewDataSet\" xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\" xmlns:msprop=\"urn:schemas-microsoft-com:xml-msprop\">\n <xs:element name=\"NewDataSet\" msdata:IsDataSet=\"true\" msdata:UseCurrentLocale=\"true\">\n <xs:complexType>\n <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n <xs:element name=\"Table1\">\n <xs:complexType>\n <xs:sequence>\n <xs:element name=\"VehicleId\" msprop:metadatacolumnname=\"VehicleId\" msprop:caption=\"VehicleId\" type=\"xs:string\" minOccurs=\"0\" />\n <xs:element name=\"VehicleName\" msprop:metadatacolumnname=\"VehicleName\" msprop:caption=\"VehicleName\" type=\"xs:string\" minOccurs=\"0\" />\n <xs:element name=\"SendAlarms\" msprop:metadatacolumnname=\"SendAlarms\" msprop:caption=\"SendAlarms\" type=\"xs:string\" minOccurs=\"0\" />\n </xs:sequence>\n </xs:complexType>\n </xs:element>\n </xs:choice>\n </xs:complexType>\n </xs:element>\n </xs:schema>\n <diffgr:diffgram xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\" xmlns:diffgr=\"urn:schemas-microsoft-com:xml-diffgram-v1\">\n<NewDataSet>\n <Table1 diffgr:id=\"Table11\" msdata:rowOrder=\"0\" diffgr:hasChanges=\"inserted\">\n <VehicleId>8</VehicleId>\n <VehicleName>AIS Gate</VehicleName>\n <SendAlarms>False</SendAlarms>\n </Table1>\n <Table1 diffgr:id=\"Table12\" msdata:rowOrder=\"1\" diffgr:hasChanges=\"inserted\">\n <VehicleId>82</VehicleId>\n <VehicleName>Amigos</VehicleName>\n <SendAlarms>False</SendAlarms>\n </Table1> \n</NewDataSet>\n</diffgr:diffgram>\n</DataSet>\n</code></pre>\n"
},
{
"tags": [
"javascript",
"json",
"apple",
"dashcode"
],
"answer_count": 0,
"favorite_count": 0,
"question_timeline_url": "/questions/6414613/timeline",
"question_comments_url": "/questions/6414613/comments",
"question_answers_url": "/questions/6414613/answers",
"question_id": 6414613,
"owner": {
"user_id": 706742,
"user_type": "registered",
"display_name": "Nero F. RoxXx",
"reputation": 8,
"email_hash": "bc2da610ac397822eeb3405b7718a9d9"
},
"creation_date": 1308588222,
"last_activity_date": 1308588222,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 2,
"score": 0,
"community_owned": false,
"title": "Using Dashcode's List Controller without their DataSource option",
"body": "<p>I'm working on my own custom google calendar, so far i'm able to get everything to work, i've loaded all the data and everything works great, each event shows up on a select box.</p>\n\n<p>What i want to do now is to load each event name on the LIST part. How exactly can i do that? i'm very lost with it.</p>\n\n<p>I looked at the sample code that dashcode has for the list part but i really am lost with populating the list in real time, can somebody help me? i can provide more info as needed, thanks!</p>\n"
},
{
"tags": [
"javascript",
"google-maps",
"marker"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6413244/timeline",
"question_comments_url": "/questions/6413244/comments",
"question_answers_url": "/questions/6413244/answers",
"question_id": 6413244,
"owner": {
"user_id": 365251,
"user_type": "registered",
"display_name": "markzzz",
"reputation": 1345,
"email_hash": "586ed1e5c3543cf7c304861c1240efdf"
},
"creation_date": 1308581995,
"last_edit_date": 1308583496,
"last_activity_date": 1308588085,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 16,
"score": 0,
"community_owned": false,
"title": "How to set the google-maps marker as it is showed on the original website",
"body": "<p>Try to Search the first address on google maps, and click on it :</p>\n\n<p>it will show us a marker with a photo (if avaiable), description, and some links.\nI'd like to add the same marker in my web application.</p>\n\n<p>Which API I need to use? At the moment I just make my own string and append it :</p>\n\n<pre><code>var finestra='';\nfinestra += '<div style=\"position:relative;width:200px;\">';\nfinestra += '<div style=\"position:relative;float:left; color:#000000;\" class=canale>';\nfinestra += 'Archimede<br />Via Brennero,12<br />38100 Trento(TN)<br />c.+39 555555555';\nfinestra += '</div>';\nfinestra += '</div>';\n\nvar marker = createMarker(map.getCenter());\nmap.setCenter(new GLatLng(46.084989,11.118851), 16, G_NORMAL_MAP);\nmap.addOverlay(marker);\nmarker.openInfoWindowHtml(finestra); \n</code></pre>\n\n<p>But I need the same marker as google maps show on the original website.\nIs it possible?</p>\n"
},
{
"tags": [
"javascript",
"jquery",
"internet",
"internet-explorer-9",
"explorer"
],
"answer_count": 0,
"favorite_count": 1,
"question_timeline_url": "/questions/6414578/timeline",
"question_comments_url": "/questions/6414578/comments",
"question_answers_url": "/questions/6414578/answers",
"question_id": 6414578,
"owner": {
"user_id": 807033,
"user_type": "unregistered",
"display_name": "Mario",
"reputation": 1,
"email_hash": "15116221263b5450dd8abff3cc7a8ea9"
},
"creation_date": 1308588053,
"last_activity_date": 1308588053,
"up_vote_count": 0,
"down_vote_count": 1,
"view_count": 14,
"score": -1,
"community_owned": false,
"title": "Javascript slider not showing in IE9",
"body": "<p>We have an automatic slider on this website, <a href=\"http://www.realcapfinancial.com\" rel=\"nofollow\">http://www.realcapfinancial.com</a> and it has been working on all browsers. IE9 doesnt seem to work. It comes up with and error, no object line 298... character 2 etc. I forget what it says but I can't check it again since I'm at work using a mac.</p>\n\n<p>Any help is perfect, thank you</p>\n"
},
{
"tags": [
"javascript",
"node.js",
"socket.io",
"nowjs"
],
"answer_count": 2,
"favorite_count": 0,
"question_timeline_url": "/questions/6409944/timeline",
"question_comments_url": "/questions/6409944/comments",
"question_answers_url": "/questions/6409944/answers",
"question_id": 6409944,
"owner": {
"user_id": 578963,
"user_type": "registered",
"display_name": "DasAntonym",
"reputation": 53,
"email_hash": "90d33a04aa3d2ba5230831650d449714"
},
"creation_date": 1308566372,
"last_activity_date": 1308588014,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 21,
"score": 0,
"community_owned": false,
"title": "NowJS manually initiating a new connection after a lost connection",
"body": "<p>i have a case where clients connect to a node.js server running nowjs and remain connected for a fairly long time (about 30 minutes). on some browsers though the connection gets dropped after a while and the client disconnects.</p>\n\n<p>i implemented a disconnect handler on the client side like this:</p>\n\n<pre><code>now.core.on('disconnect', function () {\n // we should reconnect here, maybe after a short timeout\n});\n</code></pre>\n\n<p>what i am unclear about is how exactly to trigger a reconnect. this might be something blatantly obvious to experienced users but i didn't manage to figure this out.</p>\n\n<p>the now.js script initializes on page load and after that i can use the now object, but i can't figure out how to repeat this process without reloading the page.</p>\n\n<p>thanks!</p>\n"
},
{
"tags": [
"javascript",
"regex",
"comma"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6413444/timeline",
"question_comments_url": "/questions/6413444/comments",
"question_answers_url": "/questions/6413444/answers",
"question_id": 6413444,
"owner": {
"user_id": 806905,
"user_type": "unregistered",
"display_name": "Frederick Thompson",
"reputation": 11,
"email_hash": "5698d4707354e0b9e4ba6f22a0be84d8"
},
"creation_date": 1308582827,
"last_edit_date": 1308586491,
"last_activity_date": 1308587996,
"up_vote_count": 2,
"down_vote_count": 0,
"view_count": 61,
"score": 2,
"community_owned": false,
"title": "Regex Comma Separated Emails",
"body": "<p>I am trying to get this Regex statement to work</p>\n\n<p><code>^([_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})+(\\s?[,]\\s?|$))+$</code></p>\n\n<p>for a string of comma separated emails in a <code>textbox</code> using <code>jQuery('#textbox').val();</code> which passes the values into the Regex statement to find errors for a string like:</p>\n\n<p><code>\"[email protected], [email protected],[email protected]\"</code></p>\n\n<p>But for some reason it is returning an error. I tried running it through <a href=\"http://regexpal.com/\" rel=\"nofollow\">http://regexpal.com/</a> but i'm unsure ?</p>\n\n<p><strong>NB:</strong> This is just a basic client-side test. I validate emails via the <code>MailClass</code> on the server-side using .NET4.0 - so don't jump down my throat re-this. The aim here is to eliminate simple errors.</p>\n\n<p><strong>Escaped Version:</strong> </p>\n\n<p><code>^([_a-z0-9-]+(\\\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\\\.[a-z0-9-]+)*(\\\\.[a-z]{2,3})+(\\\\s?[,]\\\\s?|$))+$</code></p>\n"
},
{
"tags": [
"javascript",
"javascript-library"
],
"answer_count": 2,
"favorite_count": 0,
"question_timeline_url": "/questions/6414240/timeline",
"question_comments_url": "/questions/6414240/comments",
"question_answers_url": "/questions/6414240/answers",
"question_id": 6414240,
"owner": {
"user_id": 806937,
"user_type": "unregistered",
"display_name": "simplified.",
"reputation": 1,
"email_hash": "e30b781f0306f0b46f32b17733b8398d"
},
"creation_date": 1308586242,
"last_edit_date": 1308586843,
"last_activity_date": 1308587979,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 35,
"score": 0,
"community_owned": false,
"title": "Constant Variables in Javascript",
"body": "<p>I am trying to have some const global variables which I can use in the javascript and I came out with this code and picking up from some answers referred in SO. But it seems that I have a little mistake somewhere which I couldn't spot. Can someone help me with this?</p>\n\n<p>in testQuery.js</p>\n\n<pre><code>(function (window, undefined) {\n\n var testQuery = function(obj) {\n if (!(this instanceof testQuery)) {\n return new testQuery(obj);\n }\n }\n\n var MYGLOBALS = function() {\n var globals = {\n foo : \"bar\",\n batz : \"blah\" \n }\n\n return {\n getValue : function(s) {\n return globals[s];\n }\n }\n }();\n\n window.testQuery = testQuery;\n\n}) (window);\n</code></pre>\n\n<hr>\n\n<p>and in the html javascript tag i have this line of code.</p>\n\n<p>in testQuery.html file</p>\n\n<pre><code><html>\n <head>\n <script src=\"testQuery.js\"></script>\n <script>\n\n function onClick() {\n\n alert(MYGLOBALS.getValue(\"foo\"));\n }\n\n </script>\n </head>\n\n <body>\n\n <input type=\"button\" onclick=\"onClick()\">\n\n </body>\n\n</html>\n</code></pre>\n"
},
{
"tags": [
"javascript",
"internet-explorer-8",
"frame",
"hang",
"google-chrome-frame"
],
"answer_count": 0,
"favorite_count": 0,
"question_timeline_url": "/questions/6414558/timeline",
"question_comments_url": "/questions/6414558/comments",
"question_answers_url": "/questions/6414558/answers",
"question_id": 6414558,
"owner": {
"user_id": 467240,
"user_type": "registered",
"display_name": "mtyson",
"reputation": 40,
"email_hash": "acd22ce8d834f8548c4200bec5fe6c40"
},
"creation_date": 1308587934,
"last_activity_date": 1308587934,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 5,
"score": 0,
"community_owned": false,
"title": "In IE8 with Chrome Frame, after Download, App hangs",
"body": "<p>Here's a strange one. Throwing it out there to see if anyone has any thoughts.</p>\n\n<p>This problem only occurs with IE8 with Chrome Frame installed. However, some machines with IE8 and chrome frame do <em>not</em> have the problem.</p>\n\n<p>When a user downloads a file, the app stops responding (the file is successfully downloaded). Links still work, but all JS appears to be blocked. If the user re-loads the browser, the app works fine, and re-downloading (even the same file) no longer causes the app to hang.</p>\n\n<p>I should add that only a small number of users have this issue (so its definitely something in the app causing the problem). The problem seems to require: certain user, certain setup with IE8+chrome frame.</p>\n"
},
{
"tags": [
"java",
"javascript",
"xml",
"regex",
"parsing"
],
"answer_count": 5,
"accepted_answer_id": 3047464,
"favorite_count": 0,
"question_timeline_url": "/questions/3047391/timeline",
"question_comments_url": "/questions/3047391/comments",
"question_answers_url": "/questions/3047391/answers",
"question_id": 3047391,
"owner": {
"user_id": 107721,
"user_type": "registered",
"display_name": "wojtek_z",
"reputation": 20,
"email_hash": "45e2bb34105769aaae7dbf841b37da84"
},
"creation_date": 1276621727,
"last_activity_date": 1308587918,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 225,
"score": 0,
"community_owned": false,
"title": "Parsing complex string using regex",
"body": "<p>My regex skills are not very good and recently a new data element has thrown my parser into a loop</p>\n\n<p>Take the following string</p>\n\n<p>\"+USER=Bob Smith-GROUP=Admin+FUNCTION=Read/FUNCTION=Write\"</p>\n\n<p>Previously I had the following for my regex : [+\\\\-/]</p>\n\n<p>Which would turn the result into </p>\n\n<p>USER=Bob Smith<br>\nGROUP=Admin<br>\nFUNCTION=Read<br>\nFUNCTION=Write<br>\nFUNCTION=Read </p>\n\n<p>But now I have values with dashes in them which is causing bad output</p>\n\n<p>New string looks like \"+USER=Bob Smith-GROUP=Admin+FUNCTION=Read/FUNCTION=Write/FUNCTION=Read-Write\"</p>\n\n<p>Which gives me the following result , and breaks the key = value structure.</p>\n\n<p>USER=Bob Smith<br>\nGROUP=Admin<br>\nFUNCTION=Read<br>\nFUNCTION=Write<br>\nFUNCTION=Read<br>\nWrite </p>\n\n<p>Can someone help me formulate a valid regex for handling this or point me to some key / value examples. Basically I need to be able to handle + - / signs in order to get combinations.</p>\n"
},
{
"tags": [
"javascript",
"jquery",
"jquery-plugins",
"jqplot",
"time-format"
],
"answer_count": 0,
"favorite_count": 0,
"question_timeline_url": "/questions/6414438/timeline",
"question_comments_url": "/questions/6414438/comments",
"question_answers_url": "/questions/6414438/answers",
"question_id": 6414438,
"owner": {
"user_id": 576364,
"user_type": "registered",
"display_name": "mcbobo",
"reputation": 3,
"email_hash": "7c269209b6935ebf04de6171e6da80a5"
},
"creation_date": 1308587186,
"last_edit_date": 1308587719,
"last_activity_date": 1308587719,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 12,
"score": 0,
"community_owned": false,
"title": "jQuery jqPlot library 12 hour Time Y-Axis Inversion issue",
"body": "<p>I've started using jqPlot recently. The generated graphs look amazing and I love it. There are a few little things to learn here and there, but overall it's great.</p>\n\n<p>I'm using the stacked bar generation and came into a werid issue. Basically, I want a 12 hour time from hours 0 - 24 on the Y axis, days on the X axis, and plot seconds of a certain activity on the graph. But also, I want the days (midnight) to start at the top of the graph, and come to the bottom.</p>\n\n<p>I can flip the data easily with an inverse of the 'min' and 'max', but the issue arises when I try to flip the ticks; essentially, the \"time\".</p>\n\n<p>I have my series defaults set to a hidden axis:</p>\n\n<pre><code>seriesDefaults: {\n renderer: $.jqplot.BarRenderer,\n yaxis: 'y2axis'\n},\n</code></pre>\n\n<p>And I put a placeholder series ( with the values all 0's, eg: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ) to associate with a separate yaxis to plot the date ticks:</p>\n\n<pre><code>series: [\n { show: true, yaxis: 'yaxis', }\n],\n</code></pre>\n\n<p>I can flip the values by changing the min and max on the default y axis and hiding it:</p>\n\n<pre><code>y2axis:{\n min: 24,\n max: 0,\n showTicks: false\n}\n</code></pre>\n\n<p>Then I set the ticks, and format them with the DateAxisRenderer:</p>\n\n<pre><code>yaxis:{\n renderer:$.jqplot.DateAxisRenderer,\n ticks: ['0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'],\n tickOptions: { formatString: '%I:%M %p' }\n}\n</code></pre>\n\n<p>This creates a yaxis with the time's from 12:00 AM to 12:00PM back to 12:00 AM in that format. but in increasing order from the bottom of the graph.</p>\n\n<p>Obviously, flipping the min and max on the 'yaxis' would accomplish nothing, as there is only place holder values, and it only flips the values. How would I go about to flip the axis values so that the time goes (from the bottom) 24, 22, 20... etc, etc, ?</p>\n\n<p>Thanks for your help in advance.</p>\n"
},
{
"tags": [
"javascript",
"jquery",
"firefox"
],
"answer_count": 6,
"accepted_answer_id": 6414466,
"favorite_count": 0,
"question_timeline_url": "/questions/6414376/timeline",
"question_comments_url": "/questions/6414376/comments",
"question_answers_url": "/questions/6414376/answers",
"question_id": 6414376,
"owner": {
"user_id": 533617,
"user_type": "unregistered",
"display_name": "David19801",
"reputation": 822,
"email_hash": "cba0529762ef11ebc58637b537a42acd"
},
"creation_date": 1308586914,
"last_activity_date": 1308587629,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 24,
"score": 0,
"community_owned": false,
"title": "Can I see what jquery is sending to an external server?",
"body": "<p>I am on a website...it has jquery and is sending some requests using javascript out to a php page. </p>\n\n<p>Is their any way to see what data it is sending out from my computer and/or which URLs it is talking to?</p>\n\n<p>I am using firefox and can load software if their is any needed.</p>\n\n<p>EDIT - I have downloaded firebug and have the page loaded. Any idea what option I need to select?</p>\n"
},
{
"tags": [
"javascript",
"html",
"text-editor",
"textwrapping"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6414473/timeline",
"question_comments_url": "/questions/6414473/comments",
"question_answers_url": "/questions/6414473/answers",
"question_id": 6414473,
"owner": {
"user_id": 807019,
"user_type": "unregistered",
"display_name": "neutreno",
"reputation": 1,
"email_hash": "86e6ff8f75f9daef42d53b7f8002fd95"
},
"creation_date": 1308587382,
"last_activity_date": 1308587609,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 17,
"score": 0,
"community_owned": false,
"title": "How to cause live text wrap while image/element is being dragged, in javascript?",
"body": "<p>I want to make a text editor which incorporates this sort of effect (see video). However, I have no idea how this would be possible with javascript.</p>\n\n<p><a href=\"http://www.youtube.com/watch?v=mYnj4Mz9g9g\" rel=\"nofollow\">http://www.youtube.com/watch?v=mYnj4Mz9g9g</a></p>\n\n<p>Any ideas would be amazing!</p>\n\n<p>Thanks</p>\n"
},
{
"tags": [
"javascript",
"javascript-events"
],
"answer_count": 4,
"favorite_count": 0,
"question_timeline_url": "/questions/6414123/timeline",
"question_comments_url": "/questions/6414123/comments",
"question_answers_url": "/questions/6414123/answers",
"question_id": 6414123,
"owner": {
"user_id": 540394,
"user_type": "registered",
"display_name": "jurchiks",
"reputation": 50,
"email_hash": "b12346cb9e2e217ae6741e6af3ee6852"
},
"creation_date": 1308585694,
"last_edit_date": 1308585896,
"last_activity_date": 1308587324,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 27,
"score": 0,
"community_owned": false,
"title": "javascript trigger function on event from a script, not explicitly from html",
"body": "<p>So I'm making a registration form ATM, I have it like I want it so far except the excess JavaScript code to check the values realtime (onmouseover, onmouseout, onblur etc.).<br>\nA small sample: </p>\n\n<pre><code><tr>\n <td>\n <label for=\"name\"\n onmouseover=\"fieldSelected('name', '', 3);\"\n onmouseout=\"checkValue('name', '', 3);\">\n Enter your name:\n </label>\n </td>\n <td>\n <input type=\"text\"\n id=\"name\"\n name=\"name\"\n onmouseover=\"fieldSelected('name', '', 3);\"\n onmouseout=\"checkValue('name', '', 3);\"\n onblur=\"checkValue('name', '', 3);\">\n </td>\n</tr>\n</code></pre>\n\n<p>fieldSelected makes the field background yellow if the value of the specified element (first parameter) matches the second parameter (default value) or is shorter than third parameter.<br>\nYou mouseover the label or the input field and it changes the bg first to yellow, then to red (since you didn't input anything).<br>\ncheckValue changes the field background to either red or green depending on the value (same parameters).<br>\nYou enter something in the input field, switch to another field and it changes the background color. </p>\n\n<p>Now, as you will probably notice, there's a LOT of JavaScript function calls right there (5 per each input/select field). It would be great if someone would know a way to attach those event triggers from another place (I don't usually code this dirty), not directly in the form like this and preferably to multiple IDs at once. I have jQuery here, but I'm really no expert in JavaScript. </p>\n\n<p>Or maybe there's a simpler way to do this? I want that the field background color changes on all those events for maximum interactivity. Sure, it's nothing much when all the data goes to the server side but I just want it that way.</p>\n"
},
{
"tags": [
"javascript",
"google-maps"
],
"answer_count": 2,
"favorite_count": 0,
"question_timeline_url": "/questions/6414093/timeline",
"question_comments_url": "/questions/6414093/comments",
"question_answers_url": "/questions/6414093/answers",
"question_id": 6414093,
"owner": {
"user_id": 365251,
"user_type": "registered",
"display_name": "markzzz",
"reputation": 1345,
"email_hash": "586ed1e5c3543cf7c304861c1240efdf"
},
"creation_date": 1308585621,
"last_edit_date": 1308586479,
"last_activity_date": 1308587198,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 19,
"score": 0,
"community_owned": false,
"title": "Why isn't this google maps loaded?",
"body": "<p>This is my code :</p>\n\n<pre><code><script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=true\"></script> \n<script type=\"text/javascript\">\n function load() {\n if (GBrowserIsCompatible()) {\n var map;\n var location = new google.maps.LatLng(46.084989, 11.118851);\n\n var stylez =\n [\n {\n featureType: \"all\",\n elementType: \"all\",\n stylers: [\n { saturation: -98 }\n ]\n }\n ];\n\n var mapOptions = {\n zoom: 11,\n center: location,\n mapTypeControlOptions: {\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'myScale']\n }\n };\n\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), mapOptions);\n var mapType = new google.maps.StyledMapType(stylez, { name: \"Grayscale\" });\n map.mapTypes.set('myScale', mapType);\n map.setMapTypeId('myScale') \n }\n }\n\n $(document).ready(function(){\n load();\n });\n</script>\n\n\n<div id=\"map_canvas\" style=\"width: 100%; height: 700px\"></div>\n</code></pre>\n\n<p>but nothing is loaded. Where am I wrong? Removing GBrowserIsCompatible() it works, but it doesn't recognize the location.</p>\n"
},
{
"tags": [
"php",
"javascript"
],
"answer_count": 3,
"accepted_answer_id": 6413910,
"favorite_count": 0,
"question_timeline_url": "/questions/6413881/timeline",
"question_comments_url": "/questions/6413881/comments",
"question_answers_url": "/questions/6413881/answers",
"question_id": 6413881,
"owner": {
"user_id": 734174,
"user_type": "unregistered",
"display_name": "Michael",
"reputation": 41,
"email_hash": "5f8a354d18429fa4d502de0b18ddaa5b"
},
"creation_date": 1308584712,
"last_activity_date": 1308587057,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 29,
"score": 0,
"community_owned": false,
"title": "Setting a maximum and minimum value for text box",
"body": "<p>I own a canvas website and want my customers to be able to enter a custom length of the canvas within a set range.</p>\n\n<p>Say the range for the product is:</p>\n\n<ul>\n<li>Minimum: 10 cm </li>\n<li>Maximum: 200 cm</li>\n</ul>\n\n<p>Then in the text box they can enter any number between that range, but if they enter \"215\" then it should automatically go down to \"200\". Likewise if they enter \"7\" then it should automatically go up to \"10\"</p>\n"
},
{
"tags": [
"javascript",
"xmlhttprequest",
"google-weather-api"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6413908/timeline",
"question_comments_url": "/questions/6413908/comments",
"question_answers_url": "/questions/6413908/answers",
"question_id": 6413908,
"owner": {
"user_id": 766182,
"user_type": "registered",
"display_name": "user766182",
"reputation": 6,
"email_hash": "3e412d974a909f07ac9382b2d46cdf80"
},
"creation_date": 1308584819,
"last_edit_date": 1308584942,
"last_activity_date": 1308587049,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 14,
"score": 0,
"community_owned": false,
"title": "Simple XMLHttpRequest (Google Weather)",
"body": "<p>Hello I want to get xml from Google Weather</p>\n\n<pre><code>var xmlhttp;\n\nif (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp= new XMLHttpRequest();\n }\nelse\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n xmlhttp.open(\"GET\", \"http://www.google.com/ig/api?weather=london&hl=en\", true);\n\nxmlhttp.send(null);\n\nxmlDoc=xmlhttp.responseXML;\n</code></pre>\n\n<p>It`s not working . Thanks</p>\n"
},
{
"tags": [
"javascript",
"forms",
"html5",
"autocomplete",
"localstorage"
],
"answer_count": 3,
"favorite_count": 0,
"question_timeline_url": "/questions/5351143/timeline",
"question_comments_url": "/questions/5351143/comments",
"question_answers_url": "/questions/5351143/answers",
"question_id": 5351143,
"owner": {
"user_id": 665929,
"user_type": "unregistered",
"display_name": "prabhat",
"reputation": 1,
"email_hash": "5de923d527dc4cd4cacbafb74d4c5d18"
},
"creation_date": 1300446824,
"last_edit_date": 1308586981,
"last_activity_date": 1308586981,
"up_vote_count": 0,
"down_vote_count": 2,
"view_count": 286,
"score": -2,
"community_owned": false,
"title": "how to create autocomplete forum using html5 local storage?",
"body": "<p>Hi to all, I am new to programming. will you help me to write code for autocomplete text fields in a html form. I want to use local storage data.\nIf any time user will inter some data in text field, it will be stored in local storage. if next time when he enters data then, localstorage data related to that field will appear as popup(like mozila or chrome autocomplete).</p>\n\n<p>please provide me some guidelines</p>\n"
},
{
"tags": [
"javascript",
"firefox",
"browser"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6413732/timeline",
"question_comments_url": "/questions/6413732/comments",
"question_answers_url": "/questions/6413732/answers",
"question_id": 6413732,
"owner": {
"user_id": 806937,
"user_type": "unregistered",
"display_name": "simplified.",
"reputation": 1,
"email_hash": "e30b781f0306f0b46f32b17733b8398d"
},
"creation_date": 1308584011,
"last_edit_date": 1308586969,
"last_activity_date": 1308586969,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 46,
"score": 0,
"community_owned": false,
"title": "Why won't this web page finish loading?",
"body": "<p>If I run this code, why doesn't the page ever finish loading? It will always show connecting on my browser tab.</p>\n\n<p>It is a simple javascript which will prompt an alert box and change the entire document to the word testing.</p>\n\n<p>Javascript - testQuery.js</p>\n\n<pre><code>(function (window, undefined) {\n\nvar testQuery = function(obj) {\n if (!(this instanceof testQuery)) {\n return new testQuery(obj);\n }\n}\n\n\ntestQuery.alertMessage = function () {\n alert(\"alert\");\n document.write(\"testing\");\n};\n\n window.testQuery = testQuery;\n\n}) (window);\n</code></pre>\n\n<p>HTML - testQuery.html</p>\n\n<pre><code><html>\n<head>\n\n<script src=\"testQuery.js\"></script>\n<script>\n\nfunction onClick() {\n\ntestQuery.alertMessage();\n\n}\n\n</script>\n</head>\n</code></pre>\n\n<p></p>\n\n<p></p>\n\n<p>\n</p>\n"
},
{
"tags": [
"javascript",
"asp.net"
],
"answer_count": 3,
"favorite_count": 0,
"question_timeline_url": "/questions/6412632/timeline",
"question_comments_url": "/questions/6412632/comments",
"question_answers_url": "/questions/6412632/answers",
"question_id": 6412632,
"owner": {
"user_id": 806682,
"user_type": "registered",
"display_name": "Peter Santos",
"reputation": 6,
"email_hash": "a2fe3b7599ef15af835ce803d5244f8e"
},
"creation_date": 1308579446,
"last_edit_date": 1308586779,
"last_activity_date": 1308586779,
"up_vote_count": 1,
"down_vote_count": 0,
"view_count": 40,
"score": 1,
"community_owned": false,
"title": "How to find and modify an asp.net control with JavaScript?",
"body": "<p>This has been bothering me for quite some time. I'm simply trying to change the value of a textbox defined in asp.net, which normally works when it is not within a LoggedInTemplate.</p>\n\n<p>I've searched everywhere on the net and even here, but the only thing I can find close to doing what I need is here <a href=\"http://stackoverflow.com/questions/3024954/finding-an-aspbutton-and-asptextbox-in-javascript\">Finding an asp:button and asp:textbox in Javascript</a>. Unfortunately that doesn't work. Here's what I have so far:</p>\n\n<pre><code><head id=\"Head1\" runat=\"server\">\n <script src=\"../../scripts/webeffects.js\" type=\"text/javascript\" language=\"javascript\"></script>\n</head>\n<asp:LoginView ID=\"LoginView1\" runat=\"server\">\n <LoggedInTemplate>\n <div class=\"lotto_pick_container\">\n <table runat=\"server\" id=\"tblLottoPick\">\n <tr><th colspan=\"3\">Pick a Lotto Number</th></tr>\n <tr>\n <td><asp:TextBox ID=\"txt1stNum\" runat=\"server\"></asp:TextBox></td>\n <td><asp:TextBox ID=\"txt2ndNum\" runat=\"server\"></asp:TextBox></td>\n <td><asp:TextBox ID=\"txt3rdNum\" runat=\"server\"></asp:TextBox></td>\n </tr>\n <tr>\n <td><asp:Button ID=\"cmdSubmitPick\" runat=\"server\" Text=\"Submit Lotto Number\" \n onclientclick=\"return validateLottoPicks()\" /></td>\n </tr>\n</table>\n </div>\n </LoggedInTemplate>\n</asp:LoginView>\n</code></pre>\n\n<p>Right now I'm trying to use an external js script to find a textbox and modify it with an arbitrary value of 12, just so that I know it can work:</p>\n\n<pre><code>function validateLottoPicks() {\n document.getElementById('<%= LoginView1.FindControl(\"txt2ndNum\").ClientID %>').value = 12\n}\n</code></pre>\n\n<p>When I debug this with Firebug it seems all my other code works, except for this one function. I have verified the function gets called, it's just this line that doesn't work. Can someone please provide some guidance? I'll send milk and cookies.</p>\n\n<p><strong>Update:</strong></p>\n\n<p>Thanks for all the help so far! I got some pretty quick responses.\n<br />\n<br />I removed the <strong>visible=\"false\"</strong> portion of the html, but no luck.\n<br />I also tried using <strong>tblLottoPick.FindControl</strong>, but no luck.\n<br />I added my header which includes the script that contains the function I am trying to run.\n<br />Using the rendered id, <strong>document.getElementById(\"LoginView1_txt2ndNum\").value = 12</strong>, works fine.</p>\n"
},
{
"tags": [
"javascript",
"jquery",
"css",
"lightbox"
],
"answer_count": 3,
"accepted_answer_id": 4529480,
"favorite_count": 0,
"question_timeline_url": "/questions/4529460/timeline",
"question_comments_url": "/questions/4529460/comments",
"question_answers_url": "/questions/4529460/answers",
"question_id": 4529460,
"owner": {
"user_id": 184814,
"user_type": "registered",
"display_name": "OM The Eternity",
"reputation": 1720,
"email_hash": "23a8b77e957cf10622f9039e4f3a954d"
},
"creation_date": 1293256850,
"last_activity_date": 1308586634,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 863,
"score": 0,
"community_owned": false,
"title": "How to fix the width and height of jquery lightbox?",
"body": "<p>I have aplied jquery lighbox on my image gallery, but due to the variable size of images, the lightbox size is not fixed hence opens up with image's original size, this in turn causes the biga images to go out of screen and display horizontal scroll bar in browser.</p>\n\n<p>Hence I am looking for the way to apply the fix width and height to lightbox so that every image must be displayed with this size in lightbox.</p>\n\n<p>Please help..</p>\n\n<blockquote>\n <p><strong>Update</strong></p>\n</blockquote>\n\n<p>i Just tried with the solution Scott (<a href=\"http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx\" rel=\"nofollow\">http://geekswithblogs.net/wojan/archive/2009/06/17/jquerylightbox.aspx</a>) has given to me, I did this,</p>\n\n<pre><code>function _resize_container_image_box(intImageWidth,intImageHeight) {\n// Get current width and height\n//rescale if necessary\nif((settings.maxWidth != null && settings.maxHeight != null) && (intImageWidth > settings.maxWidth || intImageHeight > settings.maxHeight)){\nvar isWider = intImageWidth > intImageHeight;//is the image wide or tall?\nvar scale = isWider ? settings.maxWidth/intImageWidth : settings.maxHeight/intImageHeight;\nintImageWidth = intImageWidth * scale;\nintImageHeight = intImageHeight * scale;\n}\n\n$('#lightbox-image').height(intImageHeight); \n$('#lightbox-image').width(intImageWidth); \nvar intCurrentWidth = $('#lightbox-container-image-box').width();\nvar intCurrentHeight = $('#lightbox-container-image-box').height();\n// Get the width and height of the selected image plus the padding\nvar intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value\nvar intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value\n// Diferences\nvar intDiffW = intCurrentWidth - intWidth;\nvar intDiffH = intCurrentHeight - intHeight;\n// Perfomance the effect\n$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });\nif ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {\nif ( $.browser.msie ) {\n___pause(250);\n} else {\n___pause(100); \n}\n} \n$('#lightbox-container-image-data-box').css({ width: intImageWidth });\n$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });\n};\n</code></pre>\n\n<p>AND</p>\n\n<pre><code>$('#gallery a').lightBox( maxHeight: null,\nmaxWidth: null);\n});\n</code></pre>\n\n<p>But whenever I do this and click on the image just gets open in browsers annother tab, all the lightbox functinalty fails</p>\n\n<p>Please help me to correct it</p>\n\n<p>Thanks</p>\n"
},
{
"tags": [
"javascript",
"html",
"prototype",
"prototypejs"
],
"answer_count": 1,
"favorite_count": 0,
"question_timeline_url": "/questions/6414253/timeline",
"question_comments_url": "/questions/6414253/comments",
"question_answers_url": "/questions/6414253/answers",
"question_id": 6414253,
"owner": {
"user_id": 444549,
"user_type": "registered",
"display_name": "woot586",
"reputation": 146,
"email_hash": "2b8b22a4feb9a73e64bd1a51287ef20f"
},
"creation_date": 1308586312,
"last_edit_date": 1308586544,
"last_activity_date": 1308586574,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 14,
"score": 0,
"community_owned": false,
"title": "Prototype - How to deselect the selected value from a dropdown",
"body": "<p>How do I deselect the selected value from a dropdown list using Prototype.</p>\n\n<p><strong>From</strong></p>\n\n<pre><code><select id=“mylist\">\n<option value=“val-1”>Value 1</option>\n<option value=“val-2” SELECTED>Value 2</option>\n<option value=“val-3”>Value 3</option>\n</select>\n</code></pre>\n\n<p><strong>To</strong></p>\n\n<pre><code><select id=“mylist\">\n<option value=“val-1”>Value 1</option>\n<option value=“val-2”>Value 2</option>\n<option value=“val-3”>Value 3</option>\n</select>\n</code></pre>\n\n<p>Thanks for any help in advance.</p>\n"
},
{
"tags": [
"javascript"
],
"answer_count": 12,
"accepted_answer_id": 6398800,
"favorite_count": 7,
"question_timeline_url": "/questions/6398787/timeline",
"question_comments_url": "/questions/6398787/comments",
"question_answers_url": "/questions/6398787/answers",
"question_id": 6398787,
"owner": {
"user_id": 699159,
"user_type": "registered",
"display_name": "walle1357",
"reputation": 348,
"email_hash": "1d1af4fce4b64ececdfc88b33881bbc9"
},
"creation_date": 1308429772,
"last_activity_date": 1308586389,
"up_vote_count": 44,
"down_vote_count": 1,
"view_count": 843,
"score": 43,
"community_owned": false,
"title": "Javascript Shorthand for getElementById",
"body": "<p>Is there any shorthand for the JavaScript document.getElementById? Or is there any way I can define one? It gets repetitive retyping that <strong>over</strong> and <strong>over</strong>.</p>\n"
},
{
"tags": [
"java",
"javascript",
"json"
],
"answer_count": 2,
"accepted_answer_id": 6414173,
"favorite_count": 0,
"question_timeline_url": "/questions/6414107/timeline",
"question_comments_url": "/questions/6414107/comments",
"question_answers_url": "/questions/6414107/answers",
"question_id": 6414107,
"owner": {
"user_id": 745835,
"user_type": "registered",
"display_name": "Mrshll187",
"reputation": 49,
"email_hash": "9e16629a5e67bf6bed7b1b519bceafa1"
},
"creation_date": 1308585657,
"last_edit_date": 1308586215,
"last_activity_date": 1308586215,
"up_vote_count": 0,
"down_vote_count": 0,
"view_count": 42,
"score": 0,
"community_owned": false,