Page 1 of 1
Javascript PopUp Generator
Posted: Wed Jun 25, 2008 1:35 am
by DrXThirst
Well, after seeing the site
http://bulltrue.net , I thought it would be really cool to have pictures of videos, that when clicked bring up that video in a popup. However, I didn't have a reason to make a site that did that until today when a guy had a video of him getting an extremely lucky splatter on Narrows. I Googled the JS code, and then made an app that did it for you with C#. (Yes, I'm a very bored person.) Anyways, onto features and picture.
Features:
- Options for Toolbars, Scrollbars, etc.
- Options on how the popup opens. (By a Link, a Button, or Automatically.)
- Settings for Width and Height of the Pop Up Window.
- Instructions Message Box
- Program Status Label
- Date/Time Status Bar Label
Pictures:
Pictures:
- Click [HERE] to Download.
Posted: Wed Jun 25, 2008 1:55 am
by Patrickssj6
Meh it's alright. Can you show us a few snippets of your code?
Posted: Wed Jun 25, 2008 2:15 am
by HaLo2FrEeEk
I would change the link output code to this:
Code: Select all
<a href="" onclick="javascript:popUp('[LINK HERE]');return false;">Open the Popup Window</a>
That way it won't show the javascript code being executed in the status bar of the window. The return false at the end of the onclick makes it so that href is ignored.
Posted: Wed Jun 25, 2008 2:17 am
by DrXThirst
Patrickssj6 wrote:Meh it's alright. Can you show us a few snippets of your code?
I can release the source, if you want.
Posted: Wed Jun 25, 2008 5:14 am
by Patrickssj6
I don't want the whole source. I just want to know if you found a nifty way to make the whole text creation thing...or is it simply just something like
Code: Select all
Textbox.Paste("Blehblugblah" + FirstVariable + "morebleh" + SecondVariable")
Posted: Wed Jun 25, 2008 1:52 pm
by DrXThirst
No, it's just like that.
Posted: Wed Jun 25, 2008 11:43 pm
by Patrickssj6
Posted: Fri Jun 27, 2008 5:47 pm
by Corvette19
I just realized, you could get a virus to run with that, file to be opened if clicked picture?
Posted: Fri Jun 27, 2008 5:51 pm
by Tural
No current browser would allow an executable to run without prompting the user. You cannot launch a program on the client's computer from Javascript with the current securities.
Posted: Fri Jun 27, 2008 6:18 pm
by Corvette19
Alright, that makes me feel 2x better. Thank you.
Posted: Sat Jun 28, 2008 2:44 pm
by HaLo2FrEeEk
It's still possible to get a virus from malicious Javascript, or an xml file cached by a page, it doesn't have to be an executable though that is the most common way.
And thirst, are you gonna take my advice? I don't know about you but when I'm designing a webpage I hate having the script that I'm trying to run show up in the status bar, I'd rather have the name of the page show up. Here:
http://forums.halomods.com/viewtopic.php?t=78040#795908
That'll pop you up to my post. It's just a piece of friendly advice, from a design standpoint.
Posted: Sat Jun 28, 2008 8:52 pm
by DrXThirst
Sure, but what is it exactly that you're trying to run without people knowing the link to it?
Posted: Sun Jun 29, 2008 5:51 am
by HaLo2FrEeEk
It's not that, I'm saying from a design standpoint it looks better to have
http://halomods.com in the status bar than it does to have this:
Code: Select all
javascript:popUp('http://halomods.com')
That's all I'm saying. I'm fully capable of writing all of this myself and it's been literally years since I've needed to use a code generator. I even wrote my myspace code by myself without any sort of guidance, I just trial-and-error'd everything. Anyways, I'm not saying I or anyone else wants to run something malicious using this, I'm saying from a asthetic point of view, having a load of Javascript in the status bar looks tacky...to me at least.
Posted: Sun Jun 29, 2008 1:45 pm
by DrXThirst
Oh, nevermind. I thought you were talking about something totally different.
Yeah, I'll fix that in a little while.
Posted: Wed Jul 02, 2008 1:39 am
by THE-MASTER
YEY! I love popups... jk.
I like it but would it not make sense to make a javascript/HTML version of it? I don't know. Having it in the same language kind of makes sense to me. Also if you want multiple popups with different things (like one with and one without scrollbars) this wouldn't work. What about making the function contain those variables like:
Code: Select all
function popUp(URL, toolbars, scrollbar, locationbar...){
It would make the script in both sections longer but would give you more options.
Just a suggestion.