See the following HTML example.Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Div
>
IMG
ALT
=''
SRC
= "/Upload/image/111.jpg"
/>
IMG
ALT
=''
SRC
=
I have just written something in the past two days and need to dynamically convert the SRC of IMG. I take it for granted: If (IMG. src = '1.jpg ') IMG. the result of src = '2.jpg 'cannot be changed. The IMG can be found only when alert is used. SRC
In recent work, the src attribute value (image address) of the img label in the content is often used for reading. Because the attribute value has no regularity, it is a good way to use regular expressions, next we will use php and js for instance
This article describes how to obtain the src attribute value of the link address of an image from img. This article describes how to obtain the src attribute value of the link address of an image from img.
String to be matched:
Regular expression:
This article mainly introduces PHP based on the regular batch replacement img In the SRC content to achieve the function of thumbnail, involving PHP for the page IMG elements of the regular matching and replacement operations related implementation
String to be matched: Regular expression: [^ '"] *) ['"]) | (? [^ s] *)Output result of regular expression matching:XImage/ad1.gifImage/ad2.gifPHP regular expression extraction or the src attribute value of the img element: The code is as
PHP uses regular expressions to replace the src content in Img in batches to obtain thumbnails.
This example describes how PHP can obtain thumbnails by replacing the src content in Img in batches based on regular expressions. We will share this with
The img. src local image path displayed in IE8.0 is invalid and can only be achieved through div. IE7 and IE8 are placed in & lt; divid & quot; imgPreview & quot; & gt; & lt;/div & gt. FIREFOX allows you to directly set images in & lt; imgid & quot;
IMG SRC uses base64 image dataDisplaying a picture on a webpage is usually or But if we have image base64 data, we can also use Base64 data to display a picture on the webpage;Format:The above one is to note the picture format: Image/bmp, where you
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.