sNews Forum

sNews 1.6 (previous version) => Miscellaneous Webdesign => Topic started by: howdidyouguess on July 13, 2007, 01:54:50 am

Title: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess 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
Title: i need to make a javascript pop-up.... please help!
Post by: piXelatedEmpire 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.
Title: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess 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.
Title: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess 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...
Title: i need to make a javascript pop-up.... please help!
Post by: Fred K 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...) ;)
Title: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess 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.
Title: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess 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
Title: i need to make a javascript pop-up.... please help!
Post by: Fred K 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 (http://brucelawson.co.uk/index.php/2005/opening-links-in-new-windows-in-xhtml-strict-2/).

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...
Title: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess 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
Title: Re: i need to make a javascript pop-up.... please help!
Post by: Armen 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 (http://vikjavev.no/highslide/).
Title: Re: i need to make a javascript pop-up.... please help!
Post by: Fred K on October 02, 2007, 12:34:41 pm
Quote from: Armen
Highslide

oooh, it's evolved! nice!
Title: Re: i need to make a javascript pop-up.... please help!
Post by: Patric Ahlqvist on October 02, 2007, 12:46:49 pm
Annnnd the target="_blank" do not validate.... and Highslide is cool, really cool ;)
Title: Re: i need to make a javascript pop-up.... please help!
Post by: Fred K 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...)
Title: Re: i need to make a javascript pop-up.... please help!
Post by: Patric Ahlqvist on October 02, 2007, 02:00:50 pm
Ahhh... reading closely instead of fast and manly... Got it ;)
Title: Re: i need to make a javascript pop-up.... please help!
Post by: Keyrocks 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.
Title: Re: i need to make a javascript pop-up.... please help!
Post by: mike1 on October 03, 2007, 12:15:20 am
Ahhh... reading closely instead of fast and manly... Got it ;)

This comment may have just made my day.....I was eating, and then read this, and spewed out food in laughter
Title: Re: i need to make a javascript pop-up.... please help!
Post by: howdidyouguess on October 03, 2007, 08:48:03 am
The site is now live, in case anyone would like know this. (and at http://charleswright.org if you care to see what a beautiful solution this became) And I am proud to say that sNews is under the hood! sNews was the perfect solution to this project (after doing a month of research for the right script).

Thanks 2 everyone here at sNews for everything. I am positively going to use sNews again, now that I know the way its miracle one file engine works. Simply amazing. Thanks again.

 Trent - http:hdygmedia.com
Title: Re: i need to make a javascript pop-up.... please help!
Post by: jlhaslip on October 03, 2007, 09:42:46 am
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.
interested in a CSS method for Tooltips?

http://www.jlhaslip.com/samples/tooltips/
Title: Re: i need to make a javascript pop-up.... please help!
Post by: codetwist on October 03, 2007, 06:44:43 pm
Good samples, jlhaslip ;)