0

from

https://test.com/customers/?test.html

test.html

$('#myDiv').get("https://test.com/service/customers/index.html?name=jbloggs");

<div id="myDiv"></div>

I get no data return or errors if I add function call

but if I run the same url call in browser I get the html page back

Anyone have any idea why get or load have this issue

4
  • What do you expect to receive? Are you handling rewrites on the server? Commented Jul 19, 2018 at 16:30
  • Is your script in a document ready, or after the markup? Because as you have it in your question, it is not and it is before the element it is trying to change. Commented Jul 19, 2018 at 16:31
  • I've never heard of an overload to get that takes a URL... Commented Jul 19, 2018 at 16:32
  • I have this part in both document ready and in function areas neither return the HTML back to the div, and it doesn't matter if its a get or load neither return the HTML back Commented Jul 19, 2018 at 17:42

2 Answers 2

2

I feel like you are actually wanting to use load.

<div id="myDiv"></div>

$('#myDiv').load("https://test.com/service/customers/index.html?name=jbloggs");

$.get() is just a basic ajax get request. If you want it to put the result in an element automatically, that is load()

Sign up to request clarification or add additional context in comments.

1 Comment

As I said above load doesn't return data either and no errors report
0

Thanks guys for you help turns out its a IE11 issues

Its resolved if I use firefox or edge

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.