jquery append in chrome issue

1 replies
I did something like this:

$('#test').append("<option id='ddm'>added dropdown</option>");
it shows its html in the browser but I can't see it when I view source, is this normal?

Thanks.
#append #chrome #issue #jquery
  • Profile picture of the author PaybackTony
    Originally Posted by jalicia18 View Post

    I did something like this:


    it shows its html in the browser but I can't see it when I view source, is this normal?

    Thanks.
    Yes. When you view source in firefox, it will pull the HTML of what it's currently rendering (which is great). Chrome, on the other hand, will just pull the HTML from the URL you are visiting, as in a new request. This means when you view the source, even though your dynamic content is clearly showing on the page, it wont show by default in Chrome. I believe there are plugins to view source more similarly to firefox and other browsers, but I'm not 100% on that.
    {{ DiscussionBoard.errors[5740388].message }}

Trending Topics