Archive

Posts Tagged ‘javascript’

jQuery(string) create not valid DOM when string is html with newlines

January 12th, 2009 No comments
JAVASCRIPT:
  1. function jquery_from_html(data) {
  2.         return $("<div id='inner' />").append(data);
  3. }
  4.  
  5. or
  6.  
  7. remove javascript and head overhead
  8. var htmlDOM = $("<div id='inner' />").append(html.replace(/<script [\s\S]*\/script>|<head [\s\S]*\/head>/img,""));

Categories: jQuery Tags: , ,

Javascript: Allow Only Alpha

January 30th, 2008 No comments
JavaScript:
  1. function checkkey(str)
  2. {
  3. var myRegxp = /^([a-zA-Z]+)$/;
  4. if(myRegxp.test(str)==false)
  5. {
  6.     alert( "Please enter a valid username "+str );
  7. }
  8. }

Categories: Web Tags: ,

Fly To Basket

November 5th, 2007 No comments
Categories: Web Tags: , , , ,
17039 pages viewed, 0 today
11071 visits, 0 today
FireStats icon Powered by FireStats