Friday, October 5, 2007

Genius Work-Around

Like I was saying in this post I started working on this cool little script in JavaScript that moves HTML objects around on a website, a really cool script overall for all sorts of floating message effects....

And after I got home from work a little after 7:00 AM this morning I have been working on giving it classes to be smart... actually, to move more than one HTML object around in a totally customizable fashion.

However, when doing such I ran into a little problem... apparently a problem a lot of people have with Classes or Objects and the setInterval() method...

Especially when you try to do this:

setInterval("ObjectName.methodName()", this.pinginterval);

Which made making my script work with classes a whole lot harder than I thought it was going to be!


And Nothing Here Is Or Was Helpful!

So I found my own super-Genius - with a capital G - workaround!!!

Instead of doing this ...

setInterval("ObjectName.methodName()", this.pinginterval);

... I did this ...

setInterval("functionName('"+ObjectName+"')", this.pinginterval);

This works for me because my Classes or Objects are in an array:

var Objects = new Array('ObjectName1', 'ObjectName2', ... 'ObjectNameN');

So as long as I kept passing the ObjectName as a parameter to each subsequent function I could then call anything I want from the Class or Object simply by using:

Objects[ObjectName].Paramater

What tripped me up and had me pulling my hair out trying to figure out what was wrong with a particular line I typed, was a simple syntax error - when I typed:

setInterval("functionName("+ObjectName+")", this.pinginterval);

Instead of typing:

setInterval("functionName('"+ObjectName+"')", this.pinginterval);

Did you see it?

I forgot to include the single quotes around the function's parameter...

So basically when the line I typed was processed by the browser it would have seen functionName(strObjectName); instead of functionName('strObjectName'); as it should be in proper syntax.....

A stupid mistake that sent me hunting and trying to figure out what was wrong with it for about a half hour!

And now after I finished the script the time is 3:30 PM

I've been working on it for about 7½ hours. (Once you factor in eating and watching TV for a bit as I pulled my hair out to find a solution!!)

This all just goes to show one thing....

I AM A GENIUS!!

And that's final!

Permalink/TrackBack:
http://bvanscoter.blogspot.com/2007/10/genius-work-around.html

A New Direction

Lately, I've sorta been bummed and a little depressed at how things are going, and what I'm sorta forced to do do because of my various circumstances.

So I've been thinking quite a bit about what I really want, and what I really want to do... and what I really desire to become.

What I'm about to tell you might come off as unrealistic, selfish or some other negative reflection... but I really have to write this stuff down as a way to make it more realistic and more official as a direction for what my aims are.

Oh, and these things might not be as best said or everything, but it's the core of what I really want... so with no further adieu:

What I really Want...

The time and resources (mostly monetary to get the stuff I'd like to have, but also includes non-monetary things) to do whatever I want when I feel like doing it.

Have the coolest, latest technology (mostly computer devices - hardware, software and accessories).

To sleep when I want for as long as I want, or stay up whenever I want for as long or short as I want... so that I can do whatever I want... or in other words - Not be tied to a schedule.

To work on my great web 2.0 / revolutionary web app ideas.

Have my own web hosting to sell as well as to differ the costs of hosting my websites / web app ideas mentioned above.

The Solution...

Based on what I just listed above as what I really want, the solution is provided therein.

Since I listed my desires from greatest to least (for the most-part), as a solution if I work on the list from the bottom up then each item I work on will provide the solution for the previous item.

Which is why I am so eager to start my own web hosting business.

The End Result...

The end result then would be that I would be the owner of a web technology business.

And that is what I really want to become...


AntiTrust


Gary Winston

Sorta like the movie AntiTrust, where I would be like the owner of NURV... but instead of creating the communication software stuff, it would be for creating and developing my sweet web app ideas that I have and may get.

I would be like a mix of CEO Gary Winston and the programmer Milo Hoffmann where I would enjoy running the company and using my genius to do any of coding that I would like.

However, I won't use any of the sneaky, underhanded methods that Gary Winston uses... and hopefully won't have the problems that they encounter with the law.

... Other than perhaps an unintentional monopoly!

Permalink/TrackBack:
http://bvanscoter.blogspot.com/2007/10/new-direction.html

JavaScript Action Text

I am working on this cool little script in JavaScript that will move HTML objects around on a website, a really cool script overall for the unblockable 'pop-up' floating messages and other really cool object moving uses.

I am going to be using this script on the new website I am creating for my cousin's insurance agency (VanScoter Insurance Agency) to create something that looks like the moving text on Noto Insurance's website... but the major difference is that with the script I am making it won't use flash, which is harder for search engines to read and index, and will load faster.

But, to make so that it can move multiple HTML objects on the same page that are different CSS Classes (which is how each object is identified on the page) I am needed to figure out how to use classes in JavaScript.


Web Developer's Journal

So when researching how to create and use classes I found this Tutorial on WebDevelopersJournal.com that describes how to create functions and classes...

And as it turns out, classes are easier to define and create in javascript than I thought they would be.

So once I get home (I'm doing this post at work - The Ridgemont Wegmans) I am going to fix up my script.

Permalink/TrackBack:
http://bvanscoter.blogspot.com/2007/10/i-am-working-on-this-cool-little-script.html

 

pages

legal information

privacy policy

We respect your privacy and promise to never sell, barter, share or rent your information to any unauthorized third party. By providing your contact information you are also requesting and agreeing to receive important information about future events. (You may unsubscribe at any time.)
view full privacy policy here

certification of authenticity

I certify that the information contained on this site is true and complete to the best of my knowledge and understanding, any discrepencies will be governed by the terms of use.

terms of use

Everything we provide is provided "as is" including but not limited to the implied warranties of merchantability or fitness for a particular purpose, without any promise or guarantee of earnings. All forward looking statements on any of our materials are intended as an expression our opinion and will not responsible for any incidental or consequential damages from your actions.
view official terms of use