| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
|
|
#2 (permalink) |
|
For all your goober needs
Join Date: Dec 2004
Location: Coventry, UK
Posts: 1,468
|
don't have the code to hand, but it's getElementsByClass you need to look up then once that's created an 'object' you get the innerHTML of it. Time is really the only capital that any human being has, and the one thing that he can’t afford to lose. - Thomas Edison
prem ghinde |
|
|
|
#5 (permalink) |
|
geek
|
I've never use regexp in javascript so i dont know if there is a variation in the syntax but well quick and dirty... Code:
should work so long as there are no html tags inside the div. the other way you could cheat by creating a hidden div with javascript write your variable to the div then use getElementByClass... I think that could work |
|
|
|
#7 (permalink) |
|
hmmm...
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
|
Though I'd probably be using jquery so wouldn't need to use getElementByAnything anyway. Might help if you told us what you're trying to do rather than the problem you're having, more than likely a better way to do it than regex on a variable. |
|
|
|
#8 (permalink) |
|
mingin dawg baitch
|
fair enough. I'm trying to screenscrape using javascript. I have the page I need in a variable (the pure html contents), now I need to extract an image from between a div class...should be simple enough. Why client side? cause I want to. This hidden variable malarchy sounds rather dirty, especially after looking at getElementsbyClass as a function in its own right. |
|
![]() |