Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Re: replace que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 35557 of 37168
Post > Topic >>

Re: replace question

by Rauan Maemirov <rauan1987@[EMAIL PROTECTED] > May 12, 2008 at 03:52 AM

On May 12, 4:43=A0am, Thomas 'PointedEars' Lahn <PointedE...@[EMAIL PROTECTED]
>
wrote:
> Rauan Maemirov wrote:
> > I tried to do it myself, but all I did is to replaced
>
> > <object width=3D"425" height=3D"355"><param name=3D"movie"
value=3D"URL"=
></
> > param><param name=3D"wmode" value=3D"transparent"></param><embed
src=3D"=
URL"
> > type=3D"application/x-shockwave-flash" wmode=3D"transparent"
width=3D"42=
5"
> > height=3D"355"></embed></object>
>
> > with
>
> > <object width=3D"425" height=3D"355"><param name=3D"movie"
value=3D"URL"=
></
> > param><param name=3D"wmode" value=3D"transparent"></param><img
src=3D"UR=
L"
> > type=3D"application/x-shockwave-flash" wmode=3D"transparent"
width=3D"42=
5"
> > height=3D"355"></embed></object>
>
> 1. My tests indicate that a Flash movie is not played by an `img'
element,=

> =A0 =A0so replacing the object-embed element combination would be
futile, =
even
> =A0 =A0though the `embed' element is proprietary (and therefore not
Valid)=
..
>
> 2. Using client-side scripting to correct markup is the wrong approach
> =A0 =A0as it does not need to be available.
>
> 3. If necessary, you should rewrite the editor instead.
>
> 4. FWIW, in Eclipse I would have used the following parameters:
>
> Search for:
>
(?s)<object\s+.*?<embed\s+.*?(src=3D".+?")[^>]*?\s+(width=3D.+?>)</embed><=
/object>
>
> Replace with:
> <img $1 $2 alt=3D"">
>
> (Don't forget the `alt' attribute, give it a descriptive value if
> possible/applicable!)
>
> BTW, QuickREx again came in handy in finding that out:
>
<http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html>=

>
> 5. With the exception of `(?s)', which can be worked around with
> =A0 =A0`(?:.|[\r\n])' instead of `.', this should also work with
> =A0 =A0String.prototype.replace() in JavaScript 1.5+ (Mozilla/5.0),
> =A0 =A0JScript 5.5+ (IE 5.5+), ECMAScript Ed. 3+.
>
> 6. Replacing content this way might require using `innerHTML', a
> =A0 =A0proprietary property that should be avoided in favor of DOM 2
scrip=
ting.
>
> HTH
>
> PointedEars
> --
> Anyone who slaps a 'this page is best viewed with Browser X' label on
> a Web page appears to be yearning for the bad old days, before the Web,
> when you had very little chance of reading a do***ent written on another
> computer, another word processor, or another network. -- Tim Berners-Lee

I tried to use QuickREx (application, that U noticed) and indeed, it
show matches correct. But in javascript it doesn't replace my text at
all.
 




 7 Posts in Topic:
replace question
Rauan Maemirov <rauan1  2008-05-10 08:37:52 
Re: replace question
Rauan Maemirov <rauan1  2008-05-11 11:45:01 
Re: replace question
Thomas 'PointedEars' Lahn  2008-05-12 00:43:29 
Re: replace question
Rauan Maemirov <rauan1  2008-05-12 02:03:03 
Re: replace question
Thomas 'PointedEars' Lahn  2008-05-12 12:58:53 
Re: replace question
Rauan Maemirov <rauan1  2008-05-12 03:52:40 
Re: replace question
Rauan Maemirov <rauan1  2008-05-14 03:43:09 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 9:55:02 CDT 2008.