Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

" + 
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; "" & nbsp;+& nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;+& nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  •  
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  •  
  •  
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; "+& nbsp; rs (" clid ")+" "+
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; Ngày-"& nbsp;+& nbsp; & nbsp; rs (" tdat ")+& nbsp;" "& nbsp;+
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; Ngày-"& nbsp;+rs (" ddat ")+& nbsp;" "+
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
  •  
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;}
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;}
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
  •  
  • & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
    anand

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;}

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    sir,the area where i have inserted the code is in bold and unlined
    in the result html it shows [object] as the display instead of the image

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
    anand

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;}

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    [HTML]




    Untitled Document





    [/HTML]

    & nbsp; & nbsp; & nbsp; & nbsp;
    cheers !!

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;|Select|Wrap|Line Numbers

    1. var img = '';

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    [HTML]

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?
    [/HTML]

    mỉm cười luôn luôn :) anand

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;|Select|Wrap|Line Numbers

    1. document.getElementById('imageId').style.display = '';

    & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    mỉm cười luôn luôn :) anand
    thanks a lot for the help
    it worked and yes i m using it like +img+ inside the td tag
    thanks once again:)
    smile always
    thanks forum
    people like you are examples for how things should be done
    really nice
    god bless
    anand

    3 tháng 7 '08 #3

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    mỉm cười luôn luôn :) anand
    thanks a lot for the help
    it worked and yes i m using it like +img+ inside the td tag
    thanks once again:)
    smile always
    thanks forum
    people like you are examples for how things should be done
    really nice
    god bless
    anand

    3 tháng 7 '08 #3
    Thanks for appreciating our (forum's) work. :)

    Thưa ông, tôi không thể sử dụng nó đúng cách, hãy kiểm tra mã nơi tôi nên thực hiện các thay đổi để thực hiện nó hoạt động và hiển thị nó Sir, khu vực tôi đã chèn mã in đậm và không có kết quả trong kết quả HTML nó hiển thị [đối tượng] Hiển thị thay vì hình ảnh
    Harpreet

    hiya,

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    Điều này có thể được thực hiện như thế này: [html] var im = "http://technofriends.files.wordpress.com/2008/03/google_logo_.jpg"; function created_img () {var div = document.getEuityById ("pop"); var giữ = document.createEement ("img"); giữ.src = im; giữ.border = 2; Div.AppendChild (giữ); } Tài liệu không có tiêu đề
    well i mean it
    because it feels so nice to see people helping each other where as in real life we dont find a single person supporting each other:(
    good to see good and positive people around:)
    smile always:)
    anand

    3 tháng 7 '08 #8

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    acoder

    16.027 Chuyên gia8TB Expert Mod 8TB

    Phải là một nơi khá buồn mà bạn sống.

    Không có gì ngạc nhiên khi bạn luôn đăng nhập với "nụ cười luôn luôn";)

    3 tháng 7 '08 #9

    Đăng nhập để đăng câu trả lời của bạn hoặc đăng ký tài khoản miễn phí.

    Bạn có thể đặt hình ảnh trong JavaScript không?

    Thật vậy, một cách dễ dàng để chèn hình ảnh vào trình chỉnh sửa web JavaScript Froala là sao chép một hình ảnh vào bảng tạm và dán nó vào một vị trí bạn chọn. Phím tắt để dán hình ảnh là Ctrl + v. Nếu bạn là người dùng Mac, thì bạn có thể sử dụng phím tắt CMD + V.copy an image to a clipboard and paste it into a position of your choice. The keyboard shortcut for pasting an image is Ctrl + v. If you are a Mac user, then you can use ⌘ Cmd + v shortcut.

    Bạn có thể lưu trữ một hình ảnh trong một javascript đối tượng?

    Lưu trữ hình ảnh (hoặc bất kỳ loại nội dung nào khác) trong JavaScript (hoặc CSS) được thực hiện bằng cách chỉ định sơ đồ URI đặc biệt cho dữ liệu.Về cơ bản, những gì bạn làm là tạo một đối tượng chuỗi JavaScript bình thường bằng cách sử dụng một định dạng cụ thể, trong đó bạn chỉ định loại nội dung, mã hóa ký tự và dữ liệu được mã hóa dưới dạng chuỗi Base64.. Basically what you do is to create a normal JavaScript String object using a specific format, where you specify the content type, character encoding and the data encoded as a base64 string.

    Bạn có thể lưu trữ gì trong một JavaScript biến?

    Các biến JavaScript có thể giữ các số như 100 và giá trị văn bản như "John Doe".Trong lập trình, các giá trị văn bản được gọi là chuỗi văn bản.JavaScript có thể xử lý nhiều loại dữ liệu, nhưng bây giờ, chỉ cần nghĩ về số và chuỗi.numbers like 100 and text values like "John Doe". In programming, text values are called text strings. JavaScript can handle many types of data, but for now, just think of numbers and strings.

    Hình ảnh () trong JavaScript là gì?

    Image () hàm xây dựng hình ảnh () tạo ra một thể hiện htmlimageEuity mới.Nó có chức năng tương đương với tài liệu.createdEement ('IMG').creates a new HTMLImageElement instance. It is functionally equivalent to document. createElement('img') .

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    Xin chào, tôi không chắc nhưng muốn sử dụng một biến để lưu trữ hình ảnh và sau đó hiển thị nó bên trong bảng một cái gì đó giống như
    i m not sure but wanted to use a variable to store an image and then show it inside the table
    something like

    Mở rộng | Chọn | Wrap | Số dòng|Select|Wrap|Line Numbers

    1. var & nbsp; img1;
    2. img1 = "c: \ helf.jpg";
    3.  
    4. và & nbsp; bên trong & nbsp;
    5. img1
    6.  

    img1
    is there a way to do such a thing
    pls advice:)
    smile always
    anand

    Và theo cách này, nó cho thấy hình ảnh có một cách để thực hiện một điều như vậy xin lời khuyên :) mỉm cười luôn luôn là anand

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    2 tháng 7 '08 #1

    acoder Expert Mod 8TB

    16.027 Chuyên gia8TB

    Mở rộng | Chọn | Wrap | Số dòng|Select|Wrap|Line Numbers

    1. Bạn có thể sử dụng Document.Createelement hoặc hàm tạo đối tượng hình ảnh để tạo hình ảnh và sau đó đặt SRC của nó, ví dụ:
    2. var & nbsp; img & nbsp; = & nbsp; document.createelement ("img");

    img.src = "Image.gif";

    Hướng dẫn can we store image as variable in javascript? - chúng ta có thể lưu trữ hình ảnh dưới dạng biến trong javascript không?

    2 tháng 7 '08 #2
    sir,the area where i have inserted the code is in bold and unlined
    in the result html it shows [object] as the display instead of the image

    Mở rộng | Chọn | Wrap | Số dòng|Select|Wrap|Line Numbers

    1. Thưa ông, tôi không thể sử dụng nó đúng cách, hãy kiểm tra mã nơi tôi nên thực hiện các thay đổi để thực hiện nó hoạt động và hiển thị nó Sir, khu vực tôi đã chèn mã in đậm và không có kết quả trong kết quả HTML nó hiển thị [đối tượng] Hiển thị thay vì hình ảnh
    2. chức năng & nbsp; getSearchResults ()
    3. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    4. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    5. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    6. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    7. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    8. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; +& nbsp; "; tồn tại & nbsp; bảo mật & nbsp; thông tin = false";
    9. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    10. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    11. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ;
    12. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;+& nbsp;
    13.  
    14. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ; clid & nbsp; desc ";
    15. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; var img = document.createElement("img");
    16. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    17. & nbsp; & nbsp; & nbsp; & nbsp; img.src = "logo.jpg";
    18. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
    19. & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; "& nbsp;" & nbsp;+"
    " + img + "