src

img src & jQuery?

I have an image, and using jQuery I've turned it into a button. The so called button has two states: regular and pushed. Using jQuery I detect a "mousedown" and "mouseup" and replace the "src" attribute, like so: $("#btn").click(function() { ;//DO SOMETHING HERE WHEN PRESSED }); $("#btn").mousedown(function() { $(this).attr({ src...

Can't get URL changed from IFRAME

Hi there, I have an IFRAME with a src that is a login, i'd like to know, in any way, if it has been logged in, so i tried to check if the URL has changed getting the .src property, and it is the same that the original. Is there a way, i know about the restrictions problems (it's not in my domain the url that i'm trying to get) to see if ...

Dynamically built Javascript src attribute error in IE

Controller public ActionResult GetCategories() { var htmlText = new StringBuilder(); var scriptText = new StringBuilder(); htmlText.Append("Hello world"); scriptText.AppendFormat("document.write({0});", htmlText.ToString()); var content = new ContentResult(); content.Content = script...

How to target image with certain src path with JQuery

How would I go about targeting the below img with the src file? <img src="left1.gif" alt="" /> $('img[src=left1.gif]').hide(); doesn't work ...

JavaScript SRC path not working

Hello! I have searched this web looking for an answer, but it seems that this time I'm not so lucky, so I am forced to ask. I apologize if it's already answered (could not find it). And yes, English is not my first language, so I also apologize for my spelling mistakes, I try my best. This is my problem, using Tomcat 5.5, Struts 1.3, J...

jQuery - only fires on second click when changing iframe src

I'm trying to change the src of an iframe upon submitting a form. The iframe src won't change unless I hit the submit button twice. However, if I just change the input 'type' for my submit button to 'text', it works on the first click - but obviously doesn't submit the form. <script> $(document).ready(function() { $("#form1").su...

Best method for posting page source across domains?

I'm try to figure out if there is a way to pass the page source across domains using javascript or another method each time a page is loaded? I know in javascript I can output the page source in to variables using the code below, but how would I go about passing it over to a different domain? var head_src = document.head.innerHTML; va...

getting image src in php

how to get image source from an img tag using php function. ...

I want to implement fire-and-forget request for in img src in JavaScript

I'm trying to implement fire-and-forget on an img src=... call from a web page, and am looking for the most solid method. Why? In most Web tracking systems like Omniture or Coremetrics, there is a request for an img src which also happens to carry all the data for the tracking system to record. Like any other image request, the page tri...

Matching SRC attribute of IMG tag using preg_match

I'm attempting to run preg_match to extract the SRC attribute from the first IMG tag in an article (in this case, stored in $row->introtext). preg_match('/\< *[img][^\>]*[src] *= *[\"\']{0,1}([^\"\']*)/i', $row->introtext, $matches); Instead of getting something like images/stories/otakuzoku1.jpg from <img src="images/stories/otak...

Javascript embed code that doesn't halt page rendering

I'd like to embed a number from another page. The remote call is small (only returns a number) but I would like the page to keep loading while the request is out. How should I do it? I'm currently doing <span id="target">Loading ...</span> <script> var cb = function(data) { document.getElementById("target").innerHTML = data; } </sc...

How to set the image src using jQuery

I am trying to change the image src attribute using jQuery jQuery("#imageID").attr('src','http://localhost:8080/images/1/myImage.png' ); using the above code i can change the src attribute, but when i try this:- jQuery("#imageID").attr('src',jQuery("#imageBlock").css('background-image') ); i am unable to change the src. provided...

Width and height not changing when setting img src property

Using Javascript to change an 's src... First time the width and height properties are being set correctly. The Second time they don't change. Why? So I've got this blank image on my page... <img id="imgCropImage" /> So the idea is that every time a user uploads an image, the uploader's UploadComplete callback will set this image's s...

How to get the file-path of the currenctly executing javascript code

I'm trying to do something like a c #include "filename.c", or php include(dirname(FILE)."filename.php") but in javascript. I know I can do this if I can get the URL a js file was loaded from (e.g. the URL given in the src attribute of the tag). Is there any way for the javascript to know that? Alternatively, is there any good way to lo...

How replace a part of an object attibute using jQuery?

People, here I got some answers how to replace part of a HREF attribute of a link. Eventhough I didn't understand how the "\/\/\//\"'s works. I need to do the following: A code that replace, in each "A IMG", the SRC 1.bp.blogspot.com/_YfY-Tbu-shE/S3q2T9SJQxI/AAAAAAAAAI8/w0kTOPwaxqs/s1600-h/TELA%204.png to 1.bp.blogspot.com/_YfY-Tbu-shE...

Is there any reason NOT to use src="//domain.com/file.js", which is protocol dynamic?

In some of my E-Commerce applications I've started using src="//domain.com/file.js" in cases where I needed to reference externally hosted scripts that I wanted to include. In my E-Commerce applications not all pages actually use https as not every page has a form. I'm wondering if there's really any disadvantage to always using this, a...

How can I return binary image data from an abortable AJAX request and set the result to the src of an HTML/DOM image?

I'm writing a web application that involves a continuous cycle of creating (and removing) a fair number of images on a webpage. Each image is dynamically generated by the server. var img = document.createElement("img"); img.src = "http://mydomain.com/myImageServer?param=blah"; In certain cases, some of these images outlive their usefu...

Fake the src of an iframe for printing to avoid "about:blank"

I'm creating a hidden iframe specifically to be used for printing in IE6. Here's a basic outline of the code with some HTML population cut out: $('body').append('<iframe id="printIFrame"></iframe>'); $("iframe#printIFrame").attr('style','position:absolute;width:0px;height:0px;left:-500px;top:-500px;'); $("iframe#printIFrame").load(fu...

IE7 Gets "Red X" when using jQuery Hover

Hi Guys, I am using a preview script via http://cssglobe.com/lab/tooltip/03/ The problem is that when I use SRC tag in this script - I get a big fat red X - in IE7 BEFORE the image is rendered. Once the image appears - all looks ok. Is there anyway to "hide" this before its loaded or something ? Love an help anyone can provide. ...

how do change img src.value for upload new image

hi guys, <img src="img.jpg" alt="" width="120" border="0" class="Inline" name="img" id="img" /> <input name="image" onchange="document.img.src=document.blah.image.value;" type="file" /> this code isnt work anyone know how ? ...