| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<qwertySDF> Hi, im writing a function that converts bbcodes to html but I am having trouble with the regexes <qwertySDF> text = text.replace("\[url='(.*)'\](.*)\[/url\]|\[url=(.*)\](.*)\[/url\]", "<a href='$1'>$2</a>"); <qwertySDF> [url=http://www.com]a link[/url] should be replaced by <a href="http://www.com">a link</a> <qwertySDF> the regex works within any perl regex testing programs but not javascript <Pilum> Javascript variables are not denoted by a $ <qwertySDF> Sorry I had it so that it would run within a regex testing program. if I do text.match("\[url='(.*)'\](.*)\[/url\]|\[url=(.*)\](.*)\[/url\]"); I still get nothing. <qwertySDF> The problem is the repeating characters(.*) if I do text.replace("\[url\]", "<a>"); that will work but not the repeating characters <fatbrain> ? <fatbrain> denoted by a $? <qwertySDF> Sorry fatbrain, ignore those variables, the problem is with the Regex and javascripts implementation of it <fatbrain> what variables? <qwertySDF> $1 and $2 <KYLLER`NL> can you Clone the games from www.doizece.ro ? ready to pay $$ msg me Please. Coders :) <fatbrain> qwertySDF: that's not a variable, it's a replacement *anchor*. <fatbrain> $1 is replace with capture-group #1 <qwertySDF> thanks fatbrain, however the problem at the moment is with the repeating characters within the regex. even if I do a text.match it doesnt seem to work <qwertySDF> ok for another example: <qwertySDF> text = text.replace("\[img\](.*)\[/img\]", "<img src='#1' />"); <fatbrain> text.replace("\[img\](.*?)\[/img\]", "<img src='$1' />"); <qwertySDF> ok so I have the following: <qwertySDF> test = "[img]http://www.com/image.jpg[/img]"; <qwertySDF> test.replace("\[img\](.*?)\[/img\]", "<img src='#1' />"); <qwertySDF> alert(test); <qwertySDF> I am getting a popup box with [img]http://www.com/image.jpg[/img] when I should get <img src="http://www.com/image.jpg"> <fatbrain> FFS, you'r not listening <fatbrain> text = "[img]http://www.com/image.jpg[/img]"; text = text.replace("\[img\](.*?)\[/img\]", "<img src='$1' />"); alert(text); <NeoFuture> sorry im not in the mood <[TorgoAway]> no apology needed ;) <fatbrain> got movement> https://bugzilla.mozilla.org/show_bug.cgi?id=327170 <NeoFuture> You are not authorized to access bug #327170. To see this bug, you must first log in to an account with the appropriate permissions. <NeoFuture> i cant be arsed <fatbrain> ah <fatbrain> hehe, it's flaged as *critical* a two line script that automagicly crashes the browser <NeoFuture> oh <NeoFuture> whats the lines Prv please <[furtive]> I don't got time for pain, the only pain I got time for is the pain I put on fools who don't know what time it is. <furtive> http://slayeroffice.com/code/imageCrossFade/ <vardhan> anyone have the song RoyGbic <vardhan> Roygbiv* its by Boards of Canada <vardhan> trying to figure out what the lyrics are that the girls sing in that song.. can't make it out. anyone know? <furtive> if you want the lyrics, ask google, if you want the song, ask another channel <vardhan> lol, sorry :p <vardhan> heh. google doesn't know, i've checked. but i won't press on it any further <[Torgo]> btw, the words are from rock me amadeus <furtive> really? <furtive> oh, you must me talking about the BoC song <[Torgo]> sorry, was thinking of Nlogax <[Torgo]> also BoC <furtive> how ya doing? <[Torgo]> much better <[Torgo]> prolly going back to work tomorrow <furtive> glad to hear <furtive> you were out of work? sick? <[Torgo]> yeah, thought that's what you meant <furtive> indirectly, you were quiet lately and figured you were busy <[Torgo]> http://www.nebiru.com/downloads/Nlogax.mp3 <[Torgo]> always busy ;) <[Torgo]> BoC makes fine background music when coding <[Torgo]> but i only break to Newcleus <adam25> hey guys <furtive> hi <adam25> i am trying to use javascript to load images to a div <adam25> and the code i have isn't working <adam25> hi furtive <adam25> the code i am using is <li><span onmouseover="showImage('/Feb/images/img2.jpg',this)"> <a href="Feb/images/img2.jpg" onclick="var img = document.getElementsById('Content'); <adam25> img.src = this.href; img.title = this.title; return false;">2</a></span></li> <furtive> http://www.huddletogether.com/projects/lightbox/ <adam25> hmmm <furtive> yeah <adam25> the example loads it outside the current page <adam25> my site is lifethroughpictures.org <adam25> and i need it where user's click on a number then it loads the pic in that black area <adam25> the "content" div <furtive> the onclick in your <a href=" ... makes no sense <adam25> yea well <Fleed> i have a very ez question. I really dont know why it doesnt work, this is so simple, is there anywhere i could past the script? <adam25> thats what somebody told me to do <adam25> i knew it wasn't all right :( <furtive> well, it works but overly complicated if you ask me, i'd use a function <furtive> Fleed: http://www.nomorepasting.com <adam25> can you help me with that? <adam25> i don't know js that well <furtive> adam, is your onclick all on one line? <furtive> cause you can't break lines like that <Fleed> ok I see the "0" but i dont see "1" or "2" http://www.nomorepasting.com/paste.php?pasteID=57679 <adam25> oh it needs to be? <furtive> yep <adam25> ok <adam25> so i can use what you wrote? <furtive> Fleed: it's isNaN() and not isNan <adam25> akk nm <adam25> thats for him <furtive> adam, yeah, you can use what you wrote, although i'd still use a function <Fleed> omg <Fleed> haha thanx <furtive> js is case sensitive <furtive> np ;-) <Fleed> man i feel so stupid <furtive> Fleed: don't. Peer review is often one of the best ways to get around a wall., <Fleed> yeah i no <Fleed> but im good a javascript <adam25> ok <adam25> well <Fleed> at* <adam25> i corrected it <adam25> but its still opening the image in a new window <adam25> hmmm <Fleed> i was like wtf?? IT SHOULD WORK <Fleed> hehe anyway thanx <Fleed> see ya <adam25> and not in that div <adam25> hmmmmmmm <furtive> personally i wouldn't have anything in the href (e.g. make it <a href="#" onclick="...") <furtive> but why the hell do you need js for linking to a picture <adam25> heheh <furtive> nvrmind, i realize why <adam25> i guess you don't understand what i need <adam25> i want a user to click on the numbers and have images load on the same page in the content div <adam25> which is on top of the black area <adam25> but not go to another page <adam25> is this even possiable? <adam25> with js <furtive> sure it's possible <adam25> so i don't have a million html pages <furtive> one sec <adam25> ok <adam25> thx <furtive> question though, why do you have a showImage function in the span, then you also do image replacement with the anchor...why both? <adam25> don't need both <adam25> 1 sec <adam25> just need this <adam25> <li><span onmouseover="showImage('/Feb/images/img2.jpg',this)"> <a href="Feb/html/two.html">2</a></span></li> <adam25> thats for the onmouseover event <furtive> then why do you need an anchor if you are using an onmouseover? <adam25> thats for the thumbnail <adam25> when you mouse over the number <adam25> the a tag needs to bring up the bigger version of the pic <furtive> why keep it a secret to begin with. why not just use the thumbnail as the link? <adam25> because i want to show how many pictures i have for the current month <adam25> i really don't want to line up a bunch of thumbnails <adam25> next to the big pic <furtive> and you want when they click on the link to go to the next page? <adam25> when they click on the number 2 lets say..... <adam25> i need js to load a the image on the black matte <adam25> on the left <adam25> without going to a next page <adam25> in the content div <furtive> ok, one sec, posting something <adam25> k <furtive> http://www.nomorepasting.com/paste.php?pasteID=57680
Return to
#javascript or Go to some related
logs:
HTC StreamPlayer #linuxhelp #php #teens pantherebel #skype #php rameeboy #linux .roma.itly
|
|