just pass the code you want to test, i'm doing that via a textarea at the moment.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" media="screen" /> <style type="text/css"></style> <script type="text/javascript"> function getContent(what) { var r = new RegExp(/<!-- google_ad_section_start -->([^&#172;]+)<!-- google_ad_section_end -->/g); var m = r.exec(what); if(m == null) { alert('unable to get information'); return; } else { alert(m[1]); } } </script> </head> <body> <textarea id="test" style="width: 400px; height: 200px;"><!-- google_ad_section_start --> <head> <title>Your Title Here</title> <meta name="AUTHOR" content="your name"> <meta name="DESCRIPTION" content="your description - make sure it's appropriate to your article, descriptive enough for Google search to index it correctly, and for appropriate AdSense content to be targetted."> <meta name="keywords" content="your keywords - ditto the above"> <meta name="copyright" content="Copyright (c) 2006, your name"> <meta name="robots" content="index, follow"> <meta name="revisit-after" content="1 week"> <meta name="language" content="english"> <meta name="distribution" content="global"> <meta name="rating" content="general"> </head> <!-- google_ad_section_end --></textarea> <br /><br /><input type="button" value="Get Content" onclick="getContent(document.getElementById('test').value);" /> </body> </html>



위와 같이 잘보시고 필요한것만 가지고 가서 적용해보세요

감사합니다


댓글()