dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Javascript Tags

Hybrid View

  1. #1
    Join Date
    Jul 2013
    Posts
    1

    Javascript Tags

    I'm pulling my hair out because I can't get a friggin alert to pop up when I click a link. I've been working with JQuery, so that may have something to do with it.

    There are multiple external .js files that my primary .php file references. What determines if one .js file takes presedence over another? How do I directly reference a specific bit of .js code for an individual html element? I'm not sure why this crap isn't working.

  2. #2
    Join Date
    Feb 2013
    Posts
    13
    Post the html file in whole if you can. There can be many reasons why an alert function is not working for you.

  3. #3
    Join Date
    Jul 2013
    Posts
    66
    I agree with Jptalon – we do not own functional crystal balls, so without code we are unable to help.

    However, to answer part of your question in a general sense: There is no direct principle of precedence in Javascript (in the sense of a script declaring how important it is) and there is no way to reference code from a specific external file. All Javascript code will be treated as if it was written directly into the document at the very spot the file is included. The only kind of precedence that takes place is that a script that is executed at a later point may override any scripts that have been executed before (i.e. the order of linking the files could be important – but if you experience this problem, the scripts are poorly written).
    Well-written scripts will work in a local scope and only expose very few, maybe just one or even none external references. If they do, they usually use a certain namespace. For example, the well-known jQuery library will only expose the jQuery object and the '$' shorthand notation synonym for it. Well-written plugins in return will only attach themselves in a subnamespace of jQuery's namespace.

    But, as stated before, to actually help you with your problem, seeing code is essential.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles