Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to do parsing and then storing content in the buffer

Reply
Thread Tools

how to do parsing and then storing content in the buffer

 
 
vk
Guest
Posts: n/a
 
      07-21-2006

can you help me out in this
....
<IMG style="BORDER-RIGHT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: 0px;
PADDING-LEFT: 0px; LEFT: -108px; PADDING-BOTTOM: 0px; MARGIN: 0px;
BORDER-LEFT: 0px; WIDTH: 256px; PADDING-TOP: 0px; BORDER-BOTTOM: 0px;
POSITION: absolute; TOP: -175px; HEIGHT: 256px"
src="http://mt0.google.com/mt?n=404&v=ap.14&x=1314&y=3174&zoom=4"
unselectable="on" galleryImg="no" coordX="0" coordY="0" priority="0">

i need to parse this string and i have to fetch url and coordinates
value of X and Y from this and has to store them in buffer ..
can anybody provide me with coding for this ..
thanx in advance

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      07-21-2006
vk said the following on 7/21/2006 4:12 AM:
> can you help me out in this


Yes, what do I get for it?

> ....
> <IMG style="BORDER-RIGHT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: 0px;
> PADDING-LEFT: 0px; LEFT: -108px; PADDING-BOTTOM: 0px; MARGIN: 0px;
> BORDER-LEFT: 0px; WIDTH: 256px; PADDING-TOP: 0px; BORDER-BOTTOM: 0px;
> POSITION: absolute; TOP: -175px; HEIGHT: 256px"
> src="http://mt0.google.com/mt?n=404&v=ap.14&x=1314&y=3174&zoom=4"
> unselectable="on" galleryImg="no" coordX="0" coordY="0" priority="0">


Hmmm, lots of IE crap code in there that doesn't affect me, but ok.

> i need to parse this string and i have to fetch url


"fetch url"? Just read it's src property.

> and coordinates value of X and Y from this


getAttribute('coordX')
getAttribute('coordY')

> and has to store them in buffer ..


What buffer?

> can anybody provide me with coding for this ..


Probably so.

> thanx in advance


Sure.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
 
 
 
Philipp
Guest
Posts: n/a
 
      07-22-2006
Randy Webb wrote:
> > and coordinates value of X and Y from this

>
> getAttribute('coordX')
> getAttribute('coordY')


I suppose what he actually wanted to know was how to parse the coordX
and coordY parameters with a regular expression and...

> > and has to store them in buffer ..

>
> What buffer?


.... store the matches in an array or something.

> can anybody provide me with coding for this ..


There you go:
-------------------------------------

var foo = '<IMG style="BOR [...] oordY="0" priority="0">';
var match =
foo.match(/src="([^"]+)".*?coordX="(\d+)".*?coordY="(\d+)"/);

-------------------------------------

You'll find the URL in match[1], the X coordinate in match[2] and the
the Y coordinate in match[3].

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? DR ASP .Net 2 07-29-2008 09:50 AM
When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? DR ASP .Net Building Controls 0 07-29-2008 01:37 AM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
can i modify the content in the buffer of response(not response.buffer prep) xingye ASP General 9 04-19-2004 03:49 AM



Advertisments