English 中文(简体)
Ajax和回归数据限(频率)
原标题:Ajax and returning data limit (jquery)
  1. I m using jquery to do an ajax call on 3 types of files html/javascript and img file:

    $.ajax({
        url: url,
        type: "POST",
        dataType: "text",
        async: true,
        success: function(data) {
            data = data.replace( < ,  &lt; );
            data = data.replace( > ,  &gt; );
            $( #file_content ).html( <pre>  + data +  </pre> );    
        },
        error: function(a,b,c){
            alert("There has been an error! Try again...");
        } 
    });  
    
    • The html file is this:

      <link href = "{get_url}style.css" rel = "stylesheet" type = "text/css" />
      <script language = "javascript">
          var get_url =  {get_url} ;
      </script>   
      <script src = "{get_url}functions.js" language = "javascript"></script>
      
      <div id="screen">
          <div id="floor"></div>
          <div id="ceiling"></div>
      </div>
      <div id="minimapcontainer">
          <canvas id="minimap"></canvas>
          <canvas id="minimapobjects"></canvas>
      </div>
      

    退还的数据是:

    <link href = "{get_url}style.css" rel = "stylesheet" type = "text/css" />
    

    其余部分似乎以html的形式运行,即使一米的替换时间少于或超过标记...... 确实,我需要将未处理的内容退回到html。 我如何这样做? <>strong>-SOLVED,od

  2. Now moving onto the other questions about retrieving an image from an image url and why the javascript file returns a snipped off version of the data:

    • The js file is 8956 characters long and it seems to snip it off at 8343... Why might it be doing this?
    • The image files (opening a direct url to the image) get returned as the binary data (I guess) rather than the image... The character length of the returning result is 18615. How do i return the image rather than the data the makes up the image?
最佳回答

页: 1 http://jsfiddle.net/tsrfq/。

然而,这只是取代“并”、“”和“和”的首次发生,而是使用全球的管制。

data = data.replace(/</g,  &lt; );
data = data.replace(/>/g,  &gt; );

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签