.html is actually a function. You need to replace all instances
of .html with .html()
for example:
testArray = myRe.exec( $("#wrap").html ); // Collect found
words in testArray
Should be:
testArray = myRe.exec( $("#wrap").html() ); // Collect found
words intestArray
On Oct 10, 4:07 am, fredd81 <[EMAIL PROTECTED]> wrote:
> When I try to extract all html code with $('body').html I get some
> jquery function as value, written a short test code to see if anyone
> can reproduce.
> If it´s my code has any errors in it then please correct, quite new to
> both jquery and javascript.
>
> /*** Start test tooltip ***/
> var testArray = new Array;
> var myRe;
> myRe = new RegExp("/\w/g"); // Supposed to fetch words.
> testArray = myRe.exec( $("#wrap").html ); // Collect found words in
> testArray
> document.write(testArray+"\n\n"+$("#wrap").html); // Alert array
> /*** End test tooltip ***/
> Here´s what I get..
> /*** Start Output ***/
> null
> function(value){return value==undefined?(this[0]?
> this[0].innerHTML:null):this.empty().append(value);}
> /*** End Output ***/
> Using jQuery 1.2.6 - New Wave Javascript.
>
> The plan is to find words that match a mysql db and if there is a
> match associate that word with a tooltip with more complex
> explanation. In my specific case I would use it to explain
> abbreviations.
>
> Cheers Kristofer