TipsOnLips.net

Your .net tips and tricks source

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010


Wrap an li element with an Anchor (link) element using JQuery

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

    <title>Untitled 1</title>

 

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

 

    <script type="text/javascript">

        $(function() {

        var firstLi = $('li:first');

 

        var anchor = '<a href="javascript:void(0)" onclick="myclick(\'' + firstLi.text() + '\')"></a>';

        firstLi.wrap(anchor);

        });

 

        function myclick(test) {

            alert(test);

        }

    </script>

 

</head>

<body>

    <ul id="myUL">

        <li>Dav Letterman</li>

    </ul>

</body>

</html>


Categories: JavaScript | Jquery
Posted by developer on Wednesday, December 09, 2009 1:15 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Javascript best definition of the keyword 'this'

Nettuts+ have an excellent article about Javascript object oriented programming and they came up with a very clear definition to the keyword 'this' as below:

So what does ‘this’ reference? Well in a browser, ‘this’ references the window object, so technically
the window is our global object. If we’re inside an object, ‘this’ will refer to the object itself however
if you’re inside a function, this will still refer to the window object and likewise if you’re inside a method
that is within an object, ‘this’ will refer to the object.

>Due to our scope chain, if we’re inside a sub-object (an object inside an object), ‘this’ will refer to
the sub-object and not the parent object.

Read Source Article


Categories: JavaScript
Posted by developer on Thursday, November 12, 2009 10:32 PM
Permalink | Comments (0) | Post RSSRSS comment feed

JQuery Resources 2009 Q4

  1. Easy XML Consumption using jQuery
  2. Reading XML with jQuery 

Categories: JavaScript | Jquery
Posted by developer on Thursday, September 24, 2009 11:51 PM
Permalink | Comments (1) | Post RSSRSS comment feed

Add JavaScript or CSS file programmtically to ASP.NET page

//Add CSS File
Page.Header.Controls.Add(new LiteralControl("<link href='style.css' rel='stylesheet' type='text/css' />"));

//Add JavaScript file
ClientScript.RegisterClientScriptInclude("javascriptfile", ResolveUrl("~/javascript.js"));


Categories: ASP.NET | JavaScript
Posted by developer on Wednesday, July 22, 2009 9:40 PM
Permalink | Comments (1) | Post RSSRSS comment feed

JQuery articles 2009 Q3

  1. How to implement a news ticker with jQuery and ten lines of code
  2. Use ASP.NET AJAX to Track Time Spent on a Page
  3. Easy XML Consumption using jQuery
  4. jQuery Makes Parsing XML Easy
  5. jQuery and XML
  6. Reading XML with jQuery
  7. Create an Amazon Books Widget with jQuery and XML
  8. Calling Remote ASP.NET Web Services from JQuery
  9. Using jQuery with ASP .NET
  10. Consume .Net Web service using jQuery

Categories: JavaScript | Jquery
Posted by developer on Sunday, July 12, 2009 8:55 PM
Permalink | Comments (0) | Post RSSRSS comment feed

JQuery Articles 2009 Q2

  1. Replacing images at time intervals 1 & 2
  2. 20+ Wicked Proof of Concepts for Better use of jQuery/CSS .
  3. Create a Fancy F.A.Q. Page with JQuery
  4. jquery.scrollable 1.0.2
  5. Creating a Slick Auto-Playing Featured Content Slider
  6. Force Secure Form Submission
  7. Create an apple style menu and improve it via jQuery
  8. Image Menu with Jquery
  9. jQuery Ribbon
  10. Introducing MooTools ScrollSpy
  11. Targeting Advanced Elements in jQuery
  12. Top 5 jQuery Modal Plugins
  13. 15 Awesome jQuery plug-in
  14. 15 jQuery Plugins to enhance your HTML form elements
  15. 36 Eye-Catching Jquery Navigation Menus
  16. Essential Controls List (Jquery UI Developments)
  17. JQuery Tips
  18. Uniform Plugin (Uniform Form Controls)
  19. 11 keystrokes that made my jQuery selector run 10x faster
  20. Custom jQuery selectors

Categories: JavaScript | Jquery
Posted by developer on Thursday, May 14, 2009 8:58 AM
Permalink | Comments (0) | Post RSSRSS comment feed

JavaScript Resources

  1. How-to use ClientIDs in JavaScript without the ugliness
  2. Focus in ASP.NET Controls
  3. Adding Client-Side Confirmation when Deleting
  4. Pack and minimize your JavaScript code size
  5. How to detect IE8 using JavaScript (Client side)
  6. JSAN
  7. 25 Open Source JavaScript Libraries And Frameworks - Vote For Your Favorite
  8. Localizing client side JavaScriptLocalizing client side JavaScript
  9. Overriding javascript in webresource.axd
  10. Combine, minify and compress JavaScript files to load ASP.NET pages faster
  11. Minify your Javascripts!
  12. Make your pages load faster by combining and compressing javascript and css files
  13. Downloading JavaScript Files in Parallel

Categories: ASP.NET | JavaScript
Posted by developer on Wednesday, March 25, 2009 5:32 AM
Permalink | Comments (0) | Post RSSRSS comment feed

JavaScript Get Page URL and Name - HowTo

    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
    alert(sPage);
    alert(sPath);

    Source Link

    Source 2  


Categories: JavaScript
Posted by developer on Saturday, March 21, 2009 6:36 AM
Permalink | Comments (0) | Post RSSRSS comment feed

JavaScript ToolTips resources

  1. Nice Titles revised
  2. 40+ Tooltips Scripts With AJAX, JavaScript & CSS 
  3. Pure CSS Tooltips
  4. DHTML Goodies
  5. Advanced Tooltip Control - ASP.NET AJAX
  6. ASP.NET Tooltip control 
  7. Tooltip a DIV through DOM/Javascript

Categories: JavaScript
Posted by developer on Friday, March 20, 2009 3:40 PM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET RegisterStartupScript - HOW-To

if (!this.Page.IsClientScriptBlockRegistered("hideMessage"))
{ this.Page.RegisterStartupScript("hideMessage", 
	"<script>document.getElementById('" + pnlMessage.ClientID + "').style.display = 
				 'none'</script>;"); }


Categories: ASP.NET | C# | CSS | HowTo | JavaScript
Posted by Admin on Wednesday, March 18, 2009 7:57 AM
Permalink | Comments (0) | Post RSSRSS comment feed