Archive for the 'JQuery' Category

Use JQuery Ajax to load static html page to a div tag

In one of my projects, I need to add several static pages to it. Those pages are static html and will not need update.

To make this separate from the main project which has a good MVC structure, I use JQuery’s Ajax function to load those static pages.

Continue »

Reload Javascript and rebind elements when using JQuery

I was doing a simple JQuery program. I need to add new rows and there is a delete button in each of them. The “delete” link is for deleting using Ajax. There is no problem for me to add a row using JQuery Ajax function. But the “delete” link in the newly added rows doesn’t work.

Continue »

JQuery get selected radio value

Here is the html code.

<input type="radio" name="sex" value="0" />
<input type="radio" name="sex" value="1" />

Continue »

Javascript String Empty Check

What’s the best way to check for an empty string in Javascript?

If you just want to check whether there’s any value, you can do

Continue »

How to select elements but exclude a string or exclude an element by using JQuery

Here is the code:

<div class="content">
    <a href="#">A</a></div>
<div class="content">
    <a href="#">B</a></div>
<div class="content">
    <a href="#">C</a></div>

Continue »