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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:43:45+00:00 2026-05-27T22:43:45+00:00

I have a liking script that get ID from php and insert id to

  • 0

I have a liking script that get ID from php and insert id to data base then the script shows the result by ID. I use same html code and same script for differents Ids but siledown result open on first div id instead of the ont that i click it:

HTML:

    <a href="javascript://" class="like" sta_id="1" username="{S_USERNAME}" title="Like">Like</a>
<div id="sn_likebox">
<span id="close"><a href="javascript://" class="close" title="Close This">X</a></span>
<div style="height:13px">
<div id="flash">Loading........</div>
</div>
<div id="sn_like_content">
</div>
</div>
<p>----------------------------------</p><div></div>
<p>-----------------------------------</p><div></div>
<a href="javascript://" class="like" sta_id="2" username="{S_USERNAME}" title="Like">Like</a>
<div id="sn_likebox">
<span id="close"><a href="javascript://" class="close" title="Close This">X</a></span>
<div style="height:13px">
<div id="flash">Loading........</div>
</div>
<div id="sn_like_content">
</div>
</div>

Script:

$(".like").click(function()
{
var sta_id=$(this).attr("sta_id");
var username=$(this).attr("username");
var dataString ='sta_id='+ sta_id + '&username='+ username;
$("#sn_likebox").slideDown("slow");

$("#flash").fadeIn("slow");


$.ajax({
type : "POST",
url : us_cfg.url,
data: dataString,    
cache: false,


success: function(html)
{
$("#flash").fadeOut("slow");
$("#sn_like_content").html(html);
}
});

});





$(".close").click(function()
{
$("#sn_likebox").slideUp("slow");
});

Demo:

http://jsfiddle.net/Ke5AB/112/

  • 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-27T22:43:45+00:00Added an answer on May 27, 2026 at 10:43 pm

    You cannot have two identical IDs on the same page. Use a different selector type (such as a class).

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

Sidebar

Related Questions

I have a script that pulls an image from SQL Server and displays it
I have a simple python script that updates that statuses of justin.tv streams in
So, I have page where a PHP script echoes out all of my HTML
I use PHP and MySQL to manage the content on my server/site (I have
I have a script that runs CPAN::Mini::Inject actions and has an App::Cache. It works
In php you can have the serverside script print back a block of formatted
I have a Perl CGI script that isn't working and I don't know how
We have a 'merge' script that is used to assign codes to customers. Currently
I currently have a shell script that process many images one after the other,
I have a database two tables and a linking table that I need a

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.