<blockquote> <html> <head> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.3.2"); </script> <!--Author Ganesh T a.k.a Ganex. --> <script type="text/javascript"> $(document).ready(function() { //initialization code }); function disableLink(e) { e.preventDefault(); return false; } function removeLinks(){ $('.linked').bind('click', disableLink).addClass('nolink'); } function restoreLinks(){ $('.linked').unbind('click', disableLink).removeClass('nolink'); } function getTableInfo(testval){ alert(testval+" test"); } </script> <style> .nolink { text-decoration: none; color:gray; cursor:text} </style> </head> <body> <a href="javascript:getTableInfo('1');" class="linked"> Test 1 M</a> <a href="javascript:getTableInfo('2');" class="linked"> Test 2 M</a> <a href="javascript:getTableInfo('3');" class="linked"> Test 3 M</a> <a href="javascript:getTableInfo('4');" class="linked"> Test 4 M</a> <a href="javascript:getTableInfo('5');" class="linked"> Test 5 M</a> <a href="javascript:getTableInfo('6');" class="linked"> Test 6 M</a> <a href="javascript:getTableInfo('7');" class="linked"> Test 7 M</a> <input type="button" onclick="removeLinks()" name="test" value="Remove Links"/> <input type="button" onclick="restoreLinks()" name="test" value="Restore Links"/> </body> </html> </blockquote>
Showing Hiding Anchor Tags using jQuery. Remove anchor Tags Hide Anchor Tags using jquery. Anchor tag hiding Anchor Tag CSS attributes
Please check with Manuals. Author is NOT responsible for any misinformation / incorrect information or typographical errors.
NOTE: If you would like to share any useful info, please mail to the authors.
Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts
Wednesday, September 30, 2009
Wednesday, September 16, 2009
jQuery Dynamic value updation
jQuery is one of the powerful Javascript frameworks, I have came across. It has really the potential to change the way a dynamic webpage (interms of UI) is developed. jQuery has a lot of powerful tools built-in viz., XQuery , ever powerful DOM parsing, CSS manipulation, extensibility and another power-packed tool jQuery plugins !
I am writing a following tip which can help you resolve some of your day-to-day jQuery chores. I have discovered this during my wrestling with jQuery.
Scenario: Whenever user types in the Textbox, values here $strNew and $temp1 need to be (sent) updated to the plugin (autocomplete) - "general template", which will be populated and plugin kicks in and populates the autosuggest over the textbox.
If we write
extraParams : {
// general Template -snippet
function testTemplate() {
$txtbx.bind('keydown', function(e) {
if($tokenObj.hasValues){
$tempURL="myClass/myAction.action"
}else{
$tempURL="/";
}
$strNew=$txtbx9.val();
$temp1=$tokenObj.name
// my code -snippet
$txtbox.autocomplete($tempURL, {
extraParams : {
search : function() {
return $strNew
},
businessTerm : function() {
return $temp1
}
},
(C) Ganesh T
Please feel free to add your comments / suggestions / improvements etc.,
Please check with Manuals. Author is not responsible for any misinformation / incorrect information or typographical errors.
NOTE: If you would like to share any useful info, please contact the authors.
I am writing a following tip which can help you resolve some of your day-to-day jQuery chores. I have discovered this during my wrestling with jQuery.
Scenario: Whenever user types in the Textbox, values here $strNew and $temp1 need to be (sent) updated to the plugin (autocomplete) - "general template", which will be populated and plugin kicks in and populates the autosuggest over the textbox.
If we write
extraParams : {
search : $strNew,
bizTerm : $temp1
}
values search and bizTerm will not be updated on every keydown .... if we can update the variable in the below fashion (my code), you achieve your goal of sending dynamic values to the template for generation dynamic autosuggests.
// general Template -snippet
function testTemplate() {
$txtbx.bind('keydown', function(e) {
if($tokenObj.hasValues){
$tempURL="myClass/myAction.action"
}else{
$tempURL="/";
}
$strNew=$txtbx9.val();
$temp1=$tokenObj.name
// my code -snippet
$txtbox.autocomplete($tempURL, {
extraParams : {
search : function() {
return $strNew
},
businessTerm : function() {
return $temp1
}
},
(C) Ganesh T
Please feel free to add your comments / suggestions / improvements etc.,
Please check with Manuals. Author is not responsible for any misinformation / incorrect information or typographical errors.
NOTE: If you would like to share any useful info, please contact the authors.
Wednesday, September 9, 2009
JavaScript Array List
Using JavaScript Arrays for creating Javascript Linked List - using jQuery 1.3.2 !
I tried many ways and also google for it, but i didnt get any logical answer for my requirement, many were using the traditional pointer-like based approach. Here I am using simple for loop for Traversing-forward.
About code:
Here my Object will be like ..
$valobj={
index="",
value=""
}
Functions:
put(index, value) - instead of using array index, i am using my own index to store corresponding values in the Array ($valarray).
removeval(myparam) - depending upon the param passed, i am deleting the Index.
display() - to iterate over the array !
- PLEASE FEEL FREE TO ADD COMMENTS SUGGESTIONS -
Keywords: ArrayList Javascript ArrayList Arrays List jQuery Simple List
var $valarray = [];
function put(inindex,invalue){
console.log("push with inid "+inindex+" invalue"+invalue);
var $valobj= new Object();
$valobj.index=inindex;
$valobj.value=invalue;
$valarray.push($valobj);
//console.log($valarray.length);
display();
}
function removeval(myparam){
console.log("remove this value, whose id is ->"+myparam);
$.each($valarray, function(i, value1) {
if(value1.index==myparam){
console.log("made null");
value1.value="null";
//$valarray.splice($valarray.index,1);
}
});
console.log("$valarray.lenght"+$valarray.length);
}
function display(){
console.log("valarray starts+++");
$.each($valarray, function(index, value1) {
if(value1.value!="null"){
console.log(value1.index);
console.log(value1.value);
}
});
console.log("valarray ends----");
}
NOTE: I am using FIREFOX - FIREBUG plugin for logging. You can comment that if you don't require
Subscribe to:
Posts (Atom)