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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:46:01+00:00 2026-05-23T09:46:01+00:00

I am new to Google Closure library, and I am trying to simulate something

  • 0

I am new to Google Closure library, and I am trying to simulate something similar to that of Jquery’s $.ajax function. Here is what I tried and what I got in response.

The trigger is from Chrome Extensions Right click

chrome.contextMenus.create({"title": "sample_closure", "onclick": samp.myProject.fun1,"contexts":['selection']});

This triggers the fun1 function which is defined as below:

    samp.myProject.fun1 = function(info,tab) {
    var string_url = info.selectionText;
    //String_url works fine and passed to the function below.
    samp.myProject.getAjaxData(string_url);
}

The getAjaxData function is as below.

goog.require("goog.net.XhrIo");

samp.myProject.getAjaxData = function(url) {
   goog.net.XhrIo.send(url, function(event) {
       alert(event.target.getResponseText());
   });
}

But I get this error when I call the getAjaxData function.

Error in event handler for 'contextMenus': TypeError: Cannot read property 'XhrIo' of undefined

Can anyone tell me where I am going wrong.. I checked the Argument type that need to be passed for xhrio.send function and it has string type.

  • 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-23T09:46:02+00:00Added an answer on May 23, 2026 at 9:46 am

    Solved this issue.. The path to base.js is causing this problem.

    Not deleting this question because some of you may face the same issue and leaving for them. So, Check your path to base.js of closure-library for solving this issue

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

Sidebar

Related Questions

I'm relatively new to the Google Closure library and my current obstacle is getting
First of all, I must say that I'm very new to Google Closure, but
I have been trying to create a new google custom search engine, but when
First off, I'm relatively new to Google App Engine, so I'm probably doing something
I recently switched to Google closure for a new project. I am having trouble
I'm trying to follow the grails tutorial here . When I create a new
Iam quite new to Google chart API's and I am trying to integrate it
I'm using the new Google Calendar API v3. I'm trying to obtain the users
function initialize() { var myOptions = { center: new google.maps.LatLng(23.71181,90.407467), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP
I am trying to use Google's libphonenumber library in my project. I am trying

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.