Roy Ivar Moe

Greenhorn
+ Follow
since Jun 22, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Roy Ivar Moe

Hi,

Try width:200px, instead of width:200.
It's an error in CSS not to specify a unit if the value iself is not 0.

Setting a td to 200px should cause automatic word wrapping, no need to specify this explicitly as far as I know.

Regards,
Roy
Hi Eric,

Yes this runs in the local frame.

Here's a quick test if you want to try and run it.
(Note the / in o/nload, in order to post this.)

Hmmm... I don't see why this object would differ from any other object when trying to access it across frames.



Regards,
Roy
[ February 17, 2007: Message edited by: Roy Ivar Moe ]
Hey,

I'm having difficulties getting a reference to a singleton across frames.

My singleton has this form:



I know how to reference vars, functions and objects across frames, but I just can't seem to get a reference to this singleton.

I'm trying to access the singleton (in lets say myFrame) from a function which is imported into the frameset file, and then trying to do something like:



Are there any issues with using this singleton pattern across frames?

Regards,
Roy
[ February 17, 2007: Message edited by: Roy Ivar Moe ]
It sounds like some kind of timing issue.

Are you sure that your external js files have finished loading when you try to access them? Sounds like you need some kind of callback to tell you that the dynamically inserted scripts are loaded.

One way, I guess, would be to set a flag in the main js file, to indicate that the dynamically inserted file has loaded. Then in the main js file you could have a periodical timer that checks the flags before your js logic is kicked off.


By loading js files this way, you might get a problem with users being able to interact with your page (after onload), without your js logic being completely loaded, or not?

I've never tried dynamically inserting scripts this way (only with JSON), so I don't know exactly how they do it. Maybe you can look into the scriptaculous library, or Dojo, and see how they achieve it.


Regards,
Roy
[ August 17, 2006: Message edited by: Roy Ivar Moe ]
Hi,

I guess you could include one .js file, and then dynamically insert the rest of the script tags from this file using the DOM.

Regards,
Roy
Maybe you want to redefine window.confirm all together....?

I've written down an example of how you can redefine window.alert here:

http://www.moedata.biz/blog

My example has extensive use of libraries, so the example itself might not be that useful for you, but the concept of redefining is described and there's a link in the post to some simpler code.

Regards,
Roy

[ August 17, 2006: Message edited by: Roy Ivar Moe ]
[ August 17, 2006: Message edited by: Roy Ivar Moe ]
Hey,

I suspect you are using IE( = BUGGY ).

First of all, for more ensured selection, you need to invoke both the
focus() and select() methods for your text field. Second, you need to create an artifical delay before trying to set focus to your control.

Try something like this:



You need to pass the element id instead of a reference to the element in the function above, but you could rewrite it to take an object reference if you wanted to.

Hope this helps,
Regards,
Roy

[ July 11, 2006: Message edited by: Roy Ivar Moe ]
[ July 11, 2006: Message edited by: Roy Ivar Moe ]
As new browsers are released, and new browser versions emerge, how do you know the parsing bug or feature you are relying on will not be removed or modified. How comfortable do you feel about your web page, application being future-proof when you are using a css hack?

I mean, you have lots of people who have based their hacks on features that IE doesn't support, and suddenly IE7.0/8.0/9.0 etc comes along and now IE supports these features (but the rendering bugs haven't been fixed) and will now be able to render the rules that weren't meant for IE.

There is also a readability issue. Did you notice how Eric came with a "piece of css", and then Bear Bibeault didn't understand it. Well, that kinda underlines the point.

These are just my thoughts, though,

Regards,
Roy
[ July 06, 2006: Message edited by: Roy Ivar Moe ]
Eric,

Yes, I noticed that your script would work fine with onload events, but would cause some problems if you had e.g. multiple widgets, each with submit buttons and onclick events.
This would cause, like you pointed out, a new script tag for each 'click', to be added to the DOM, it would also cause the queue to keep growing...

After I saw your code, I refactored it into a JSON library, and next I will have to add logic to handle the issues that was mentioned above.
I've heard that there might be an issue with IE caching requests, but I haven't expericened that so far. This might also have to be handled in such a library.

This has been a really educational thread for me, looking forward to see something like this appear in the MEAP

Tanks,
Roy
Hey,

I'm personally against css hacks.

First of all I agree with Eric on the doctype.

Then I would make sure that you have:



so you know you are working with "a clean slate".

If this doens't work, you can use JavaScript if this is supported by your clients. With JavaScript you can sniff the browser, then assign a class attribute to the body tag e.g. <body class="ie">

This way your css can look like this:



Now that's more readable than any hack...!

This also gives you a way to really fine-tune your css. Imagine hypothetical something like this:



you get the idea.

This method is promoted by Scott Isaac over at Microsoft Spaces, only they put the class attribute in the html tag, which doesn't validate.

Hope any of this helps...

Regards,
Roy
[ July 06, 2006: Message edited by: Roy Ivar Moe ]
Eric,

This is similar to what I tried after your last post. However, I failed to to use the call function in order to get the right context in the instance callback function. Very nice.

Regards,
Roy
[ July 06, 2006: Message edited by: Roy Ivar Moe ]
Great example, Pavan. This is definitely a valid way to achieve instance callbacks.

Thank you for taking the time to put together this example, it clearly illustrates how to solve the problem I tried to address.



----------

I'll just post a link here back to the original article by Pavan Keely:

http://www.ajaxinfo.com/default~viewart~27.htm


I observed the same behaviour when I tried your example in IE and in FF.
Sorry, can't tell you what causes this though. Probably another IE bug, right?

Regards,
Roy
Notepad++ is nice. You can customize the syntax highlighting too.