Is it correct that page elements created by jQuery do not show up in the source code

后端 未结 6 1513
猫巷女王i
猫巷女王i 2020-12-22 04:03

I have the following code (snippet):

 var numRows = $table.find(\'tbody tr\').length;
var numPages = Math.ceil(numRows / numPerPage);
var $pager = $(\'

        
相关标签:
6条回答
  • 2020-12-22 04:14

    Yes they do NOT show up,

    elements created with javascript arent't visible in the 'View source' part of the browser.

    0 讨论(0)
  • 2020-12-22 04:20

    You could use FireBug to find it if you needed to see it in action.

    0 讨论(0)
  • Yes, this is correct.

    In firefox you can see the latest source by selecting everything on the page (ctrl+a) and then using rightmouse+view selection source. Or even better, you should install firebug.

    0 讨论(0)
  • 2020-12-22 04:27

    Yes. The elements are added directly to the DOM, and not visible via normal view source.

    0 讨论(0)
  • 2020-12-22 04:32

    Yes. The source is just used to build the initial DOM that represents the document. Dynamically created elements are only inserted in the DOM.

    But you can analyse such elements with a DOM viewer like Safari’s WebInspector or the Firefox extionsion Firebug. Firefox can also show source code that represents such dynamically created elements by selecting that element an choosing View Selection Source in the context menu.

    0 讨论(0)
  • 2020-12-22 04:35

    In IE, after pressing F12 and then in HTML section you can press the refresh button to see the updated code.

    0 讨论(0)
提交回复
热议问题