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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:47:40+00:00 2026-05-22T16:47:40+00:00

Possible Duplicate: what is the point of void in javascript What is purpose of

  • 0

Possible Duplicate:
what is the point of void in javascript

What is purpose of using void here ? if just remove void(), it should also work, right?

var b=document.body;

if(b&&!document.xmlVersion) {
   void(z=document.createElement('script'));
   void(z.src='http://www.google.ca/reader/ui/subscribe-bookmarklet.js');
   void(b.appendChild(z));
}
else {
  location='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href);
}
  • 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-22T16:47:41+00:00Added an answer on May 22, 2026 at 4:47 pm

    I googled your code snippet and it looks like its typically embedded in a link with “javascript:” in front of it. To quote the Mozilla reference for the void operator:

    JavaScript URIs

    When a browser follows a javascript: URI, it evaluates the code in the URI and then replaces the contents of the page with the returned value, unless the returned value is undefined. The void operator can be used to return undefined. For example:

    <a href="javascript:void(0);">Click here to do nothing</a>
    <a href="javascript:void(document.body.style.backgroundColor='green');">Click here for green background</a>
    

    Note, however, that javascript: URIs are now often discouraged over other alternatives, such as events.

    source: https://developer.mozilla.org/en/JavaScript/Reference/Operators/Special/void

    So it keeps the contents of the page from being overwritten when the code is executed inside of a link.

    In this case, if the code is executed without the javascript: URI, the void operator should not make any difference. The void operator simply evaluates its input expression and returns undefined.

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

Sidebar

Related Questions

Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} What's the
Possible Duplicate: Zoom in on a point (using scale and translate) I want to
Possible Duplicate: “Undefined reference to” template class constructor I've just started using templates, and
Possible Duplicate: Floating point inaccuracy examples In my computer and using g++ I found
Possible Duplicate: At what point does using a StringBuilder become insignificant or an overhead?
Possible Duplicate: What's the point of OOP? What are the advantages of using object-orientated
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's

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.