1

This is all happening in ie9 and using jQuery 1.4.3 (yes, I know its old; I'm stuck with it for now)

I've used jQuery.ajax() to read some html from a file on the server and store it in a variable called data.

Then I create a jQuery object as follows:

view = jQuery(data);

Then I add it to my page:

 bod = jQuery('body');     
 bod.append(view);

It appears but I am unable to highlight/select anything on the page, regardless if I added as I've just described OR if it was hard coded into the html.

I haven't the faintest idea why.

If I do NOT do bod.append(view) the text hard coded into the html IS highlightable/selectable.

Again, I haven't the faintest idea why.

Here's the absolutely bizarre part. If I open IE developer tools and pin/unpin it to the browser window then everything is highlightable/selectable again - the stuff that was hard coded into the html and the stuff i added via jQuery.

I need everything on the page to be highlightable/selectable (position the mouse pointer, left click and drag to right OR left click and drag to left) as soon as the page renders.

Has anyone faced anything remotely similar to this and what did you do?

user1126515
  • 1,133
  • 3
  • 17
  • 34
  • Are you sure that the view object contains the same data you are hardcoding? – Justin Self Jun 19 '14 at 01:12
  • do you have console object in your code..? – Sudhir Bastakoti Jun 19 '14 at 01:38
  • @justnS the view is actually populated later. But the fact remains, after it is added neither it or anything on the screen before it was added is highlightable/selectable. – user1126515 Jun 19 '14 at 02:43
  • @user1126515 see this post:: http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once may be it's useful – Sudhir Bastakoti Jun 19 '14 at 03:14
  • @Sudhir - removed all references to console.log. still have the problem. although i discovered that everything IS highlightable/selectable BEFORE bod.append(view) is executed. – user1126515 Jun 19 '14 at 12:19

0 Answers0