Gaurav_0093 Gaurav_0093 - 4 years ago 72
jQuery Question

Binded list is not showing in html view source in knockout.js?

I am using knockout js to bind the list of links in my table here is the code

<table class="table table-bordered">
<th style="width:10%;">#</th>
<th style="width:50%;">Link</th>
<th style="width:20%;">Active</th>
<th style="width:20%;">Action</th>
**<tbody data-bind="foreach:LinkList">**
<td data-bind="text:$index()+1"></td>
<td><span data-bind="text:$data.LinkName.length <= 40 ? $data.LinkName : $data.LinkName.substring(0, 40) + '...'"></span></td>
<input type="checkbox" data-bind="checked:$data.IsActive" disabled />
<button class="btn btn-xs btn-primary" type="button" title="Edit"
<span class="glyphicon glyphicon-edit"></span>
<button class="btn btn-xs btn-danger" type="button" title="Delete"
<span class="glyphicon glyphicon-trash"></span>

Here I used the foreach to bind the list of links to display it on HTML page
I am attaching the link of that page also

but when you inspect the html page in page source then link is not showing in its source code?
so how can i display those links in page source also?
Is there is any way to show it?

Answer Source

The source code displayed is whatever the server returns for the client when the page is requested -- you are actually making DOM manipulations which won't modify the original source. What you can do is to check the DOM's current state with a developer tool like Firebug or move the logic to the server side which will return the generated HTML.

jQuery DOM changes not appearing in view source

createElement() not showing up in view source

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download