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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:50:31+00:00 2026-05-23T14:50:31+00:00

I’m having a problem.. Actually I do have an issue when sending a value

  • 0

I’m having a problem..

Actually I do have an issue when sending a value from a child page to the parent page.
I’m actually loading a page via JQuery and that page is getting refreshed to display new results, but one of these problems is that the function from the parent page doesn’t get called from the child page.
Although this works perfect on Google Chrome, Opera and Safari, it doesn’t seem to work on Firefox.
I heard Firefox doesn’t manage events the same way as Safari or Google Chrome does?
I’ve been searching on answers for this but I couldn’t find anything pretty much..

Alright, here’s what I’m doing:

The child page calls another file which has all the functions that make my site work, this is what should trigger the function:

$like = "<a href='$comment_poster' id='$msgid' class='like' 
         onclick='parent.likecomment(this);'>Like</a>";
echo "$like";

And this is the function that gets fired from the onclick event which is located in the parent page (the function is in the parent page the onclick is in the child page):

This function is the one that receives the id from the child page to later on add the value to the database.

function likecomment(commentID)
{
    event.preventDefault();
    var likeid = commentID.id;
    var author = ($(commentID).attr('href'));

    // forming the queryString
    var data = 'likeid='+ likeid + '&author=' + author;
    if(likeid) 
    {
        // ajax call
        $.ajax({
              type: "POST",
              url: "likeprofmessage.php",
              data: data,
              beforeSend: function(html) 
              { 
                  $(".word").html(likeid);
              },
              success: function(html){ 
                  $("#resultsprofcomments").fadeIn('slow');
                  $('#profcommentsdiv').load('showprofmessages.php?vprofile=<?php echo $row['1'];?>').fadeIn("slow");
                  $("#resultsprofcomments").append(html);
              }
        });
    }
}

I’ve tried the Firefox console and I’ve received the error: event is undefined so this should be a problem on how Firefox manages events.
Again, any help is appreciated, thank you very much.

  • 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-05-23T14:50:32+00:00Added an answer on May 23, 2026 at 2:50 pm

    I think the following will work as long as you set the onclick handler inline in your HTML (as you did in your example):

    <A href="..." onclick='parent.likecomment(event,this);'>blah</A>
    
    <SCRIPT>
    
    function likecomment(evt, commentID) {
      evt.preventDefault();
      var likeid = commentID.id;
      // etc
    }
    
    </SCRIPT>
    

    For event handlers not set inline in HTML, the standards compliant browsers (including FF) should automatically pass the event object as a parameter to your handler function. IE, up to version 8, anyway, uses a different event model and lets you reference event directly – really it is window.event but generally as with most window properties it works even if you omit window..

    So if you assign your click handler on document ready (or onload) you can do this:

    function yourOnloadFunction() {
      document.getElementById('yourElementId').onclick = clickHandler;
    }
    
    function clickHandler(e) {
      // check if event object was passed in, otherwise use window.event
      if (!e) e = window.event;
    
      // but how to get a reference to the clicked element?
      // use the event object's target property, except (of course)
      // in IE, which uses srcElement:
    
      var elRef = e.srcElement ? e.srcElement : e.target;
    
      // rest of your function here, e.g.
      e.preventDefault();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a bunch of posts stored in text files formatted in yaml/textile (from
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.