WELCOME Abdennour : Software engineer

Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

May 8, 2013

Jquery Template Clear Cache


Problem
I have the following code :

    var data = "<li><b>${a}</b> (${b})</li>";
    $.template( "compiledItem",data );

The instruction above is called "compilation of template" or "Caching a template " via jquerty template  using String value as a identifier. (String =>'compiledItem')

When i modify markup value, i want to clear the cache

  How Can i delete the template cache?

Solution


Add before compilation instruction the following instruction :

     delete $.template["compiledItem"];

Apr 1, 2013

JQuery Plugin for WaterMark Input Text




There are other tutorials that implement the input watermark. But this tutorial has two added values:
First, there is a JQuery plugin, so the flexibility of use and reuse
Secondly, it is an improvement. Indeed, when  focusing on input, it is necessary that the watermark remains visible.

Demo : 

1.Import my JQ plugin :  

<script src="http://dl.dropbox.com/u/55765722/delivred/abdennour/lib/js/jquery.inputeffect.1.0.js" type="text/javascript"></script>

2. Create input element for test : 

 <input type="text" id="wmark" style="width:300px;font-size: 15px" />


3. Call plugin by one line : 

$('#wmark').watermarkit();




4.Call and set your custom text mark 


$('#wmark').watermarkit("Put your title here");





5.ٍSource code