1
About the Javascript functions that add HTML content, these added contents are not being shown in the page’s source code, even if it works.
Example:
<html>
<head>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
</head>
<body>
</body>
<script>
$("body").append("<p>Apareço no carregamento normal, mas não no código fonte </p>");
</script>
</html>
I have a jQuery table plugin, but it can’t select the table because it doesn’t have the columns yet and as I create the columns dynamically, I end up not being able to use the plugin.
--EDIT-- My problem was with the asynchronous function of the ajax. I had a function to activate the plugin, and before it the function with ajax, since the function of ajax still did not return a value, I could not activate the plug because the object did not yet exist. The solution was to put the plugin activation in ajax Success
Changes made by JS will only be present in the DOM, because it is the browser that deals with this. The source code will always be the one the browser received from the HTTP request. If you need something to be in the source code, you need to put it there explicitly. If you want something dynamic you can try using a server-side language.
– Woss
You can pick up content dynamically added to the DOM. But you need to show how it’s done.
– Sam
You could inform which plugin is using ?
– NoobSaibot
Better would be you put the example of your real doubt, with the table and the plugin, that it becomes easy to help the community
– Isac