Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a native solution for jq's .load? #88

Closed
Tedko opened this issue Feb 2, 2016 · 1 comment
Closed

Is there a native solution for jq's .load? #88

Tedko opened this issue Feb 2, 2016 · 1 comment

Comments

@Tedko
Copy link

Tedko commented Feb 2, 2016

I have read the discussions on stackoverflow and seems there's still no good native solution to replace .load(). Then how do you guy deal with .load?

@camsong
Copy link
Owner

camsong commented Feb 3, 2016

It's pretty easy to replace with fetch.

// jquery
$(selector).load(url);

// native
fetch(url).then(data => data.text()).then(data => document.querySelector(selector).innerHTML=data)

@camsong camsong closed this as completed Feb 3, 2016
camsong added a commit that referenced this issue Feb 3, 2016
camsong added a commit that referenced this issue Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants