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

JavaScript

 
QuestionComet hints Pin
mehrdadc4817-Apr-12 21:11
mehrdadc4817-Apr-12 21:11 
QuestionCode does't work on a MVC partial view rendering Pin
Kenneth McCoy11-Apr-12 7:36
professionalKenneth McCoy11-Apr-12 7:36 
AnswerRe: Code does't work on a MVC partial view rendering Pin
Kenneth McCoy12-Apr-12 6:46
professionalKenneth McCoy12-Apr-12 6:46 
Questionhow to detect upload dialog closing? Pin
Ali Al Omairi(Abu AlHassan)9-Apr-12 4:58
professionalAli Al Omairi(Abu AlHassan)9-Apr-12 4:58 
AnswerRe: how to detect upload dialog closing? Pin
Mohibur Rashid15-Apr-12 19:17
professionalMohibur Rashid15-Apr-12 19:17 
QuestionUse getElementById without request to server Pin
Christi50007-Apr-12 22:05
Christi50007-Apr-12 22:05 
AnswerRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)8-Apr-12 3:11
professionalAli Al Omairi(Abu AlHassan)8-Apr-12 3:11 
GeneralRe: Use getElementById without request to server Pin
Christi50008-Apr-12 6:12
Christi50008-Apr-12 6:12 
Thanks for your reply!
Well I tried to inject the JS code to a web, all things worked fine except the dynamic image.

Some of the codes are:
C#
<pre lang="cs">
var image = document.getElementsByTagName(&#39;img&#39;)[9];
alert(image.src);
//(Just to clarify again (image.src) is a thing like [http://random.com/random.jpg] which is purely random pic shown after every request.

var req =new XMLHttpRequest();
req.open(&amp;quot;GET&amp;quot;, image.src, true);
  req.onreadystatechange = function() {
      if (req.readyState == 4) {
        if (req.status == 200) {
var data =req.responseText;

//following try to append the same image but the result is different
var data_array = [];
    for (var i = 0; i &amp;lt; data.length; i++)
      {
        data_array.push(data[i].charCodeAt(0) &amp;amp; 0xff);
      }

for (var i = 0; i &amp;lt; 10; i++)
      {
 var o = document.body;
var div = document.createElement(&amp;quot;div&amp;quot;);
 div.innerHTML = data_array[i];
    o.appendChild(div);
}
        }
      }
    };
&lt;/pre&gt;</pre>

GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)9-Apr-12 2:39
professionalAli Al Omairi(Abu AlHassan)9-Apr-12 2:39 
GeneralRe: Use getElementById without request to server Pin
Christi50009-Apr-12 5:05
Christi50009-Apr-12 5:05 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)11-Apr-12 0:18
professionalAli Al Omairi(Abu AlHassan)11-Apr-12 0:18 
GeneralRe: Use getElementById without request to server Pin
RichardGrimmer11-Apr-12 5:31
RichardGrimmer11-Apr-12 5:31 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)11-Apr-12 6:01
professionalAli Al Omairi(Abu AlHassan)11-Apr-12 6:01 
GeneralRe: Use getElementById without request to server Pin
RichardGrimmer11-Apr-12 21:30
RichardGrimmer11-Apr-12 21:30 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)12-Apr-12 5:19
professionalAli Al Omairi(Abu AlHassan)12-Apr-12 5:19 
AnswerRe: Use getElementById without request to server Pin
Angel13209-Apr-12 20:53
Angel13209-Apr-12 20:53 
QuestionJavascript Pin
Manikandan H4-Apr-12 21:02
Manikandan H4-Apr-12 21:02 
AnswerRe: Javascript Pin
ZurdoDev12-Apr-12 8:58
professionalZurdoDev12-Apr-12 8:58 
QuestionHow to find the row in the gridview that was selected Pin
MacIntyre4-Apr-12 13:24
MacIntyre4-Apr-12 13:24 
AnswerRe: How to find the row in the gridview that was selected Pin
Angel13209-Apr-12 20:52
Angel13209-Apr-12 20:52 
QuestionSenior Software Engineer (PayPal) Pin
jinrunping30-Mar-12 16:19
jinrunping30-Mar-12 16:19 
QuestionNewbie Question Pin
pix_programmer25-Mar-12 19:37
pix_programmer25-Mar-12 19:37 
AnswerRe: Newbie Question Pin
Dalek Dave26-Mar-12 22:34
professionalDalek Dave26-Mar-12 22:34 
GeneralRe: Newbie Question Pin
RichardGrimmer11-Apr-12 5:36
RichardGrimmer11-Apr-12 5:36 
AnswerRe: Newbie Question Pin
Richard MacCutchan27-Mar-12 22:34
mveRichard MacCutchan27-Mar-12 22:34 

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.