Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: i need to make a javascript pop-up.... please help!  (Read 6005 times)

howdidyouguess

  • Newbie
  • *
  • Karma: 0
  • Posts: 23
i need to make a javascript pop-up.... please help!
« on: July 13, 2007, 01:54:50 am »

Well, I have been having problems getting a javascript pop-up to work from within sNews. All I need is a new window (sized window with no browser navigation) to pop-up that contains an art gallery when someone clicks a link on a sNews page. So far I have had trouble with named anchors (but devised a work-around) and this javascript thing. Has anyone else had this problem? I am open to suggestions.

Thanks,

Trent
Logged

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
i need to make a javascript pop-up.... please help!
« Reply #1 on: July 13, 2007, 02:59:51 am »

Maybe you could share with us what you are using at present so we can see how you are approaching this and what might be causing the problem.
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

howdidyouguess

  • Newbie
  • *
  • Karma: 0
  • Posts: 23
i need to make a javascript pop-up.... please help!
« Reply #2 on: July 13, 2007, 03:08:04 am »

I am using sNews 1.6, and here is the link to the page in question http://charleswright.org/home/admissions . If you look at the lower sideboxes on the left and right, there is an image link to an art gallery on the left, and an image link to a video on the left. Both of these links are supposed to open in a new no-nav resized window, but for some reason it isn't working. Also using firefox as the testing browser. Thank you for your time with this.
Logged

howdidyouguess

  • Newbie
  • *
  • Karma: 0
  • Posts: 23
i need to make a javascript pop-up.... please help!
« Reply #3 on: July 13, 2007, 03:11:27 am »

the problematic code is located at approx line 164 when you view the source, just fyi. Thanks again...
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
i need to make a javascript pop-up.... please help!
« Reply #4 on: July 13, 2007, 04:04:40 am »

First of all you should fix the double title problem in your <head>. The sNews function call <?php title(); ?> includes <base href>, <title> and a couple of <meta> tags (keywords and description), so you should not hard code those bits as well into your index.php. Use only <?php title(); ?> to bring these bits in.

As for the javascript problem, I'll leave that over to Joost, he has a trick he likes to toot his horn about. Personally, if I use javascript to force new windows on unsuspecting users (not always a good idea btw, esp. without telling them what will happen when they click link), I prefer to use a simple script contained in an external file, but that's me. As I said, Joost has another, perhaps better solution, which validates with xhtml1 strict.

Speaking of which, you also have a number of minor errors among your ...eherm... tables, which you might want look into. Mostly it seems to be html 4 ending tags used with the xhtml1 strict doctype that's the cause (and I'll admit to not have looked very closely, tables makes my eyes go blurry...) ;)
« Last Edit: October 02, 2007, 12:37:41 pm by Fred K (agentsmith) »
Logged

howdidyouguess

  • Newbie
  • *
  • Karma: 0
  • Posts: 23
i need to make a javascript pop-up.... please help!
« Reply #5 on: July 13, 2007, 05:31:43 am »

Thank you for your help! I know the code is a mess... I took over the project from multiple failed attempts at making a static site into a cms. And I know about the forcing javascript on people, but the client wants what the client wants. Look at this for a laugh, these guys wanted me to lock up their whole site with a password on the home page. I can bet they will be calling me back to fix their site when they get no hits... look --> http://xfactoradvertising.com

Thanks agent smith, I am still looking for more replies... (hint... joost ;-)

Hope everyone is staying cool.
Logged

howdidyouguess

  • Newbie
  • *
  • Karma: 0
  • Posts: 23
i need to make a javascript pop-up.... please help!
« Reply #6 on: July 13, 2007, 05:41:57 am »

Oh, and I know that tables are not too cool in the post-CSS world... This project was handed off to me and I just want to get it to work, and be done with it. But I have run across some problems... I suppose I could clean up the  too... that might be nice of me to do. (lol, Im really not an idiot, and if I am and idiot, at least I can portray a reasonable facsimile of competence when I need to).  :-D
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
i need to make a javascript pop-up.... please help!
« Reply #7 on: July 13, 2007, 07:32:59 am »

hm, I should really have learned by now to dou ... triple-check sources before I quote them ... it was mike who had a different solution to offer, not Joost, even if I'm sure Joost knows it too ... ;)
Sorry for any confusion.

Anyway, what mike likes to point out whenever we drag out the single file javascript solution is that you can use this thing instead, much shorter and works the same way.
Quote
<a href="http://www.some-site.com" onclick="target='_blank';">
The script I prefer to use is a bit longer but storing it in an external file helps separating content and non-content (styles, scripts, whathaveyou), which is something I always strive for. But that's me.
An explanation of the script and how it works is here.

As for tables not being cool -- they are cool when used for tabular data. This has more to do with the semantic web (e.g. using html items for their intended purpose) (like that will ever truly happen) than CSS. Though that is a complete aside, hardly worth the time it took to read it... :)

Ah, clients. What will they think of next, I wonder...
« Last Edit: October 02, 2007, 12:38:22 pm by Fred K (agentsmith) »
Logged

howdidyouguess

  • Newbie
  • *
  • Karma: 0
  • Posts: 23
i need to make a javascript pop-up.... please help!
« Reply #8 on: July 13, 2007, 10:28:51 am »

Agent smith... Thank you a thousand times! I was aware of the target='blank' method, but in firefox it will usually just open in a new tab and not a dreaded pop-up. The second longer external solution that you provided looks like it will do the trick. I appreciate the help!

Trent
Logged

Armen

  • Sr. Member
  • ****
  • Karma: 41
  • Posts: 338
    • http://www.funnydays.ru
Re: i need to make a javascript pop-up.... please help!
« Reply #9 on: October 02, 2007, 09:42:47 am »

Agent smith... Thank you a thousand times! I was aware of the target='blank' method, but in firefox it will usually just open in a new tab and not a dreaded pop-up. The second longer external solution that you provided looks like it will do the trick. I appreciate the help!

Trent

You can also try Highslide script. See it here: Highslide.
Logged
Now ogres, oh, they're much worse. They'll make a suit from your freshly peeled skin. They'll shave your liver, squeeze the jelly from your eyes... Actually, it's quite good on toast.

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: i need to make a javascript pop-up.... please help!
« Reply #10 on: October 02, 2007, 12:34:41 pm »

Quote from: Armen
Highslide

oooh, it's evolved! nice!
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Re: i need to make a javascript pop-up.... please help!
« Reply #11 on: October 02, 2007, 12:46:49 pm »

Annnnd the target="_blank" do not validate.... and Highslide is cool, really cool ;)
« Last Edit: October 02, 2007, 12:49:08 pm by Patric Ahlqvist »
Logged
"It's only dead fish that goes with the flow... "
Updated

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: i need to make a javascript pop-up.... please help!
« Reply #12 on: October 02, 2007, 12:51:45 pm »

Patric, read closely. ;)
(It says onclick="target='_blank';", not just "target=_blank". Validation is in the difference...)
(I've done the same mistake a number of times...)
« Last Edit: October 02, 2007, 01:00:12 pm by Fred K (agentsmith) »
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Re: i need to make a javascript pop-up.... please help!
« Reply #13 on: October 02, 2007, 02:00:50 pm »

Ahhh... reading closely instead of fast and manly... Got it ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: i need to make a javascript pop-up.... please help!
« Reply #14 on: October 02, 2007, 11:18:30 pm »

Quote from: Armen
Highslide
oooh, it's evolved! nice!
I just installed it this afternoon in my latest "1.6 ME" project and... hey... it was pretty easy to implement. Works like a charm. I want to (first) try and use this as a "User Tips" engine... to access Admin Tips pop-ups from each of the Admin Panels. The ajax bit looks promising for that application.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: [1] 2