[solved] inject - internet explorer

General Discussion about Mootools 1.2

Moderator: 1.2 Moderators

[solved] inject - internet explorer

Postby akurtula on Thu Jun 11, 2009 3:28 pm

hi

i am trying to inject an image on the page using the inject feature in mootools. this does work on firefox, but does not work on internet explorer:

this is what i have:
  1. $('thump1').addEvent('click', function(e){
  2.         $('thump').empty();
  3.                
  4.         new Element('img',{
  5.         'src':'headphones.jpg',
  6.         'width':'200px',
  7.     }).inject($('thump'));
  8.     })


do you have any suggestions on how to make this work on IE

thanks
Last edited by akurtula on Wed Jul 08, 2009 7:13 pm, edited 2 times in total.
akurtula
 
Posts: 8
Joined: Thu Jun 11, 2009 3:20 pm
Location: manchester (UK)

Re: inject - internet explorer

Postby daKmoR on Thu Jun 11, 2009 4:53 pm

  1. $('thump1').addEvent('click', function(e){
  2.     $('thump').empty();
  3.     new Element('img',{
  4.         'src':'headphones.jpg',
  5.         'width':'200px', // <-- remove trailing slash (IE doesn't like this)
  6.     }).inject($('thump'));
  7. })
"Speak when you are angry and you will make the best speech you will ever regret." - Ambrose Bierce
User avatar
daKmoR
Site Admin
 
Posts: 860
Joined: Mon Jul 14, 2008 11:40 am

Re: inject - internet explorer

Postby akurtula on Thu Jun 11, 2009 5:24 pm

it works now
thanks daKmoR
akurtula
 
Posts: 8
Joined: Thu Jun 11, 2009 3:20 pm
Location: manchester (UK)


Return to General

Who is online

Users browsing this forum: MSN [Bot] and 1 guest