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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:49:35+00:00 2026-06-06T17:49:35+00:00

As another post I’ve made noted, I don’t have much experience with jQuery, and

  • 0

As another post I’ve made noted, I don’t have much experience with jQuery, and I apologize for that. What I’m trying to do seems fairly simple.

Overview:
I have a table wrapped in a div. Within that table, each row represents a distinct element. I have it setup such that when a link is clicked in each row, the corresponding data for that element is displayed in a div next to the table. This part works.

What I’m trying to do:
I would like the top of the popup div to display inline with the table row that is selected.

Here’s my simplified code:

    <div id="container" style="display:inline-block">
       <table>
          <tr id="selected_row">
             <td>
                <a href="/gohere" onclick="updatePos('#param_detail_container');">
                   @Html.DisplayFor(model => item.Name)
                </a>
             </td>
          </tr>
       </table>
    </div>

    <div id="popupDiv" style="display:inline-block; position:absolute; ">
        Contenet in here...
    </div>

Script:

    <script type="text/javascript" src="~/Scripts/jquery-1.6.2.min.js"></script>
    <script type="text/javascript">
       $(document).ready(function updatePos(popupDiv) {
          var top = $('#selected_row').offset().top;
             popupDiv.css({ top: top + "px" }).show();
          });
    </script>

I receive the following error:

    Microsoft JScript runtime error: Unable to get value of the property 'replace': object is null or undefined

‘replace’ is located inside of jquery1.6.2.min.js. I’m assuming this has something to do with how I’m trying to set the top attribute of the popupDiv. Any suggestions?

  • 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-06T17:49:37+00:00Added an answer on June 6, 2026 at 5:49 pm

    function must be global, so put it outside ready:

    /*$(document).ready(function() {
    
    });*/
    
    function updatePos(popupDiv) {
          var top = $('#selected_row').offset().top;
          $(popupDiv).css({ top: top + "px" }).show();
       }
    

    in your case no need to use $(document).ready

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

Sidebar

Related Questions

I have the same question that was asked in another post except I'm having
I have read on another post ( how to dismiss action sheet ) that
Similar to another post I made, this answers that post and creates a new
I have read another post/question regarding jquery variables and it was useful but I'm
I have the following data: A post called Hello has categories greet Another post
I am making a POST to another php file that I want to render
I have a page from a 3rdparty I want to post to another page
I have seen on another post this and its confusing me... public class MyClass
I have seen another post similar to this one on the website but the
I recently saw this code on another post ( jQuery Set Cursor Position in

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.