Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8507689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:56:28+00:00 2026-06-11T02:56:28+00:00

Suppose I have an html string like so : var string = ‘<div><img src=foo/bar

  • 0

Suppose I have an html string like so :

var string = '<div><img src="foo/bar" /></div>';

and I select the image part of it like so :

var $img = $(string).find('img');

and then I change the ‘src’ attribute :

$img.attr('src', 'foo2/bar2');

Does this trigger an automatic AJAX get request at the new ‘src’? I’m getting a rogue GET error in my code that goes away when I comment out the line above, but maybe it’s coming from somewhere else.

If this is in fact coming from Jquery, is there a way to turn off or block the AJAX request? I’ve tried .stopPropogation() without any luck…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:56:29+00:00Added an answer on June 11, 2026 at 2:56 am

    in case that $img is a real dom elemnt (exists in your html) – a get reqest will fire.

    if $img is not you won’t trigger a get request but you can still trigger it by:

    $img[0].src = '/foo/bar'
    

    example

    the only way you can stop a browser from rendering images is by stopping it:

    if(window.stop !== undefined)
      window.stop();    
    else if(document.execCommand !== undefined)
      document.execCommand("Stop", false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have the following HTML: <div id=test> <span style=display:inline;>foo</span> <span style=display:none;>bar</span> <span style=display:inline;>baz</span>
A newbie question,really. Suppose I have a html table like this: <div id=div1> <table
Suppose I have an HTML snippet like this: <div> Hello <strong>There</strong> <div>I think <em>I
Suppose I have this html markup: <div id=wrapper> <pre class=highlight> $(function(){ // hide all
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
I have an html string I'd like to dump directly into an element. This
Suppose I have a body of text (string) like this: str = 'This is
Suppose I have ViewModel like public class AnotherViewModel { public string Name { get;
Suppose I have an html page source like: <p><font face=Arial color=#400040><small><strong> <a href=some_link>description</a>: </strong>some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.