$('#dropDownId :selected').text();
Friday, October 5, 2018
Get Url Parameter in JQuery
Get Url Parameter in JQuery
// Assuming url "http://www.abc.com?cd=1234&name=ram kumar"
<script>
function getUrlParameter(param_name) {
param_name = param_name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + param_name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
$(document).ready(function () {
alert(getUrlParameter("cd"));
var v_cd = getUrlParameter("cd");
var v_name = getUrlParameter("name");
});
</script>
Result
123
ram kumar
Print table in JQuery
<table border="1" cellpadding="3"
id="printTable">
<tbody><tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
<tr>
<td>Adam</td>
<td>Johnson</td>
<td>67</td>
</tr>
</tbody></table>
<br />
<br />
<button>Print me</button>
JQuery is...
function printData()
{
var divToPrint=document.getElementById("printTable");
newWin= window.open("");
newWin.document.write(divToPrint.outerHTML);
newWin.print();
newWin.close();
}
$(document).ready(function(){
$('button').on('click',function(){
printData();
})
})
Subscribe to:
Posts (Atom)
Linq Expression syntax for where condtion in linq
(Expression<Func<T, bool>> filter)
-
Page preview on single click VS2015 or further or on single click page open in solution explorer Menu>Tools>Options>Environment...
-
1.Class [MetadataType(typeof(auth_model_mas_meta))] public partial class auth_model_mas { public string model_id {...