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

  • Home
  • SEARCH
  • 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 9260001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:47:21+00:00 2026-06-18T12:47:21+00:00

I wrote this script for javascript disabled browser. Here is HTML: <a href=http://www.google.com/ onClick=jstest();>Google</a>

  • 0

I wrote this script for javascript disabled browser.

Here is HTML:

<a href="http://www.google.com/" onClick="jstest();">Google</a>

Here is Javascript:

<script type="text/javascript">
    function jstest() {
    alert("Success");
    // show popup
    return false;
    };
</script>

If javascript is enabled it should alert a popup showing success. And if it is disabled it should move to google page. I was told to do this by a friend. It works on jsFiddle.net. But not working if i try to do this in my work.

It shows popup when i click and when i close popup it moves onto google page.

I want it to stay on the same page. I dont want it to move on link page.

It should move only if javascript is disabled.

What have i done wrong in this script?

Thank You,

Kishore.

  • 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-18T12:47:22+00:00Added an answer on June 18, 2026 at 12:47 pm

    Try this as your hyperlink:

    <a href="http://www.google.com/" onClick="return jstest();">
    

    The return within the onClick should confirm that the return false from your function should bubble up to the hyperlink’s behavior.

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

Sidebar

Related Questions

I wrote this jQuery code: <script type=text/javascript> $.ajax({ url: http://www.mysite.com/login.aspx, context: document.body, success: function(html)
$(function(){ $('a').each(function(){ var x=this.href; this.href=www.somesitename.com/filter+this.href; }); }); i wrote the above jQuery script to
Kind of new to learning jQuery, I wrote this script. <script type=text/javascript> $(document).ready(function(){ alert($(#myInput).value);
This script cannot find bannersize unless I write <div id=bannersize></div> before the javascript. The
I wrote this script which counts occurrences of particular pattern in a given file.
I wrote this script to for a contact form on my website, everything works
Hey, I recently wrote this fairly simple game of life in JavaScript. Within this
I'm learning basics of JS and I wrote this script but it doesn't work
With jQuery Mobile, I use this snippet to call libaries... <script src=//code.jquery.com/jquery-1.6.4.min.js></script> <script> if(typeof
I wrote this javascript Function : function ShowMsg(msg) { $.blockUI({ message: '<div dir=rtl align=center><h1><p>'

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.