User Profile

Collapse

Profile Sidebar

Collapse
Arodicus
Arodicus
Last Activity: May 1 '08, 09:12 PM
Joined: May 2 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • [QUOTE=Arodicus]I like your way a little better, since it doesn't create the extra Script and avoids document.write, so I'll test to see how well it works on all major browsers. [QUOTE]

    Slight modification to your code:

    Code:
    var scr=document.getElementsByTagName('script');
    var src=scr[scr.length-1].getAttribute("src");
    alert(src);
    ... which now works great! Thankas for the input, this...
    See more | Go to post

    Leave a comment:


  • I like your way a little better, since it doesn't create the extra Script and avoids document.write, so I'll test to see how well it works on all major browsers.

    Both approaches suffer a fatal flaw, though; they assume the currently-executing script hasn't already injected another script into the page, which is a dangerous assumption: both methods will pick up the wrong script, which may be sourced differently.

    In that...
    See more | Go to post

    Leave a comment:


  • This is extremely useful if you're trying to load assets other than javascript that happen to be in the same directory as the script. This is particularly true if you're trying to get the same group of assets to load across multiple servers, and don't necessarily have control over the who|what|where factors.

    For instance, I have a utility program written as several SWFs which are stored along with the support javascript that loads...
    See more | Go to post

    Leave a comment:


  • Arodicus
    started a topic How JavaScript can get its own File Path

    How JavaScript can get its own File Path

    I'm trying to get the pathname of the .js file that the currently-executing function resides in. This is useful if your .js file loads other assets within (or based on) the directory your .js file is in.


    After being told by several folks it wasn't possible, I actually figured out a way (shown below), so
    1. I'm posting it so others may benefit, and
    2. You can tell me if there are any potential bugs.
    3. You can tell me if there's
    ...
    See more | Go to post

  • Does JavaScript support some kind of __Resolve method?

    I have a dynamic class. I would like to be able to attempt to access properties and methods on that class, and if they do not exist, I want the Class to handle the problem in a specific way, rather than throw an exception.

    Thsi needs to be done internally to the class, not with an external "try" clause. In some languages this is known as a __resolve function.

    thus

    [CODE=javascript]var foo = new...
    See more | Go to post
    Last edited by gits; Apr 4 '08, 03:27 PM. Reason: fix code tags

  • Arodicus
    replied to get name of var as a string?
    No, that's not quite right... the methods in Something are more or less irrelevant, except that they need to pass "foo" (as a string) into the ActiveX/Plugin that it generates.

    In other words var "foo" is going to either be COMPLETELY REPLACED or at least needs to EVALUATE to something other than what it was originally created with.

    It must be a string, because the Plugin works by script injection...
    See more | Go to post

    Leave a comment:


  • Arodicus
    started a topic get name of var as a string?

    get name of var as a string?

    Given something like this:

    Code:
    var foo = new Something()
    is there any way for the Something class to know it's being put into "foo" (as a String)?

    The only thing I can come up with so far is blatantly feeding it:

    Code:
    var foo = new Something("foo")
    Which my client, of course, doesn't like doing... they need it as idiot-proof as possible.

    Background:...
    See more | Go to post

  • Thanks. After extensive testing, the issue appears to be in the interface between the Flash plugin and Firefox; when performing a GetObjectByID on the object, it incorrectly interprets the DOM object as being a function, despite actually being an htmlEmbedElemen t. IE however, interprets the Flash Player as an a proper Object (because it sees the Object, not the Embed).

    I'm not sure who's to blame here... Adobe's interface or Mozilla...
    See more | Go to post

    Leave a comment:


  • Shortcut to Class Method fails in firefox, works in IE.

    I have a static class method, MyObject.MySub. MyMethod(), which points to a handler in a Flash SWF (but I think that's inconsequential ). In reality, the path is a lot longer, so I'd like to make a simpler way for other programmers to access that method, such as this:

    var MyFunc = MyObject.MySub. MyMethod

    So they could just call MyFunc() instead. This "proxy" or "shorthand" works great in IE, but fails...
    See more | Go to post

  • It started out as an experiment but now we're looking into using it to help address numerous VERY specific browser bugs; for instance turning off certain features in safari mac 2.0.0.6 but leaving them on in 2.0 and 3.0.

    I realize the code is a little bloated but part of the requirement is that a team of people with only minimal coding skills will be taking over the project eventually; therefore it's clearer to keep everything in data...
    See more | Go to post

    Leave a comment:


  • How do I reference <HTML> element via Javascript?

    This is bugging me: how do I reference the topmost node (HTML) within a document? I'd like to set a class on it, which specifies various browser/os/versions so that several browser/os/version-specific css bugs may be addressed without coding. eg: <HTML class="_IE _IE7 _Win _IE7Win">

    The closest I've come is document.body.p arentNode (line 22, below), but this of course requires that my script be executed from within...
    See more | Go to post

  • Arodicus
    started a topic Send Params to XSLT Client-Side Only?
    in XML

    Send Params to XSLT Client-Side Only?

    Is there a way to send a parameter/variable to my XSLT using ONLY client-side methods for normal browsers?

    My host doesn't allow any server-side scripting. There are plenty of examples for doing this with ASP or PHP, or by using proprietary client-side interpreters, but this isn't allowed. I was hoping for a JavaScript or Query-String solution? Or maybe there's a way to do a double-transform and limit my data set?

    What...
    See more | Go to post
No activity results to display
Show More
Working...