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 8884519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:04:47+00:00 2026-06-14T21:04:47+00:00

I have this code, where data is DWR object that contains rows from response

  • 0

I have this code, where data is DWR object that contains rows from response servlet.
img.onclick works using IE9 but I need that it works on IE8 too. Some idea?
Thanks!

function functionA(data){
  var getPrintCred = function(data) { 
                        var img = document.createElement("img");
                        img.src = "images/image1.jpg";
                        img.style.width="20px";
                        img.style.height="18px";
                        img.alt = data.field1;
                        img.title = getRegimen;
                        img.onclick = function(target) { functionB(target) };
                        return img;
  };
}

function functionB(data){
                var var1= data.target.title;
                var var2= data.target.alt;
                if ( var1 != null && var1 == "IM")
                    var1 = "valueA";
                else
                    var1 = "valueB";
                functionC(var2,var1);
}

function functionC(param1, param2){
 alert ('Using IE 9 works, but IE8 no works...help me!'+param1+'-'param2);
}
  • 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-14T21:04:48+00:00Added an answer on June 14, 2026 at 9:04 pm

    Ie 8 does not support the target property in the event object, you have to use srcElement property.

    function functionB(data){
                var var1= (data.target || data.srcElement).title;
                var var2= data.target.alt;
                if ( var1 != null && var1 == "IM")
                    var1 = "valueA";
                else
                    var1 = "valueB";
                functionC(var2,var1);
    }
    

    Also it looks like no event object is passed to the onclick event handler, so you can pass window.event as a fallback.

    img.onclick = function(target) { functionB(target || event) };
    

    http://jsfiddle.net/mowglisanu/wkB6K/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that is captured in the jquery Data object from a
I have this code which export data from GridView to csv. It works with
I have this code which works at retrieving data from You Tube. I can
I have this code that fetches data from mySQL and outputs it as an
I have this code to display the data retrieved from DB in accounts_view.php :
I have this code to update my SQL database from data in a textbox,
i have this simple code to load data from other php page using get
i have this code for get data from textfield: <script type=text/javascript> var mod=document.getElementById(mod).value; ajax(mod);
i have this code that passes the core data context to one of the
I have this code # data = {blah blah}; for object in my_queryset(): object.data

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.