[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Convert jquery ajax call to pure javascript

Posted on 2016-10-25
3
Medium Priority
?
179 Views
Last Modified: 2016-11-01
HI,
I am currently using jquery to make an ajax call :
$.ajax({
        url: url,
        type: 'POST',
        contentType: 'application/json',
        headers: {
            'X-hfh': this.data
        },
        dataType: 'json',
        success: function(result) {
            $.each(result, function(idx, item) {
                mybuddyList.push({
                    DisplayText: item.name,
                    JID: item.id,
                    ImageURL: item.profileImage
                });
            });
        },
        error: function() {
            console.log("Error");
        }
    });

Open in new window

I want to get rid of jquery and use only javascript to achieve the same.
How do i do it.

Thanks
0
Comment
Question by:Rohit Bajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Accepted Solution

by:
Kim Walker earned 1200 total points
ID: 41859718
There are entire books written about how to do ajax without jQuery. If you insist on doing it without using jQuery, I would suggest Head First Ajax by O'Reilly. But I highly recommend using jQuery.
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 600 total points
ID: 41865811
How do i do it.
Open for example this one : https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js

Go to line 7116 to 8101 to see what jQuery do.
You need to cleanup the code.
If you find any jQuery use, check if you can do simpler or just do a new search inside the file.

It's not a simpler job as it required to have lot of time maybe it's your case.
0
 
LVL 43

Assisted Solution

by:Rob
Rob earned 200 total points
ID: 41866527
Given jQuery IS JavaScript this seems like an odd request... There's no reason to ever do this unless this is for an assignment?

https://www.experts-exchange.com/articles/12264/Javascript-Frameworks-what-are-they.html
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question