Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6388371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:16:14+00:00 2026-05-25T03:16:14+00:00

Here’s my code <script type=text/javascript href=http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js></script> <script type=text/javascript href=js/js.js></script> … <input type=text name=city onkeyup=loadStation(this.value);/>

  • 0

Here’s my code

<script type="text/javascript" href="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" href="js/js.js"></script>
...
<input type="text" name="city" onkeyup="loadStation(this.value);"/>
...

and the js.js file

//Load Stations
function loadStation(stationCity){
  alert(stationCity);
}

When I try to trigger the loadStation onkeyup, nothing’s happening. The path of js/js.js is ok since in the source I can load it.

What could be wrong ?

EDIT

I fell really stupid…. instead of href=”” it should have been src=””. The funiest thing is that even you guys haven’t notice it 😛

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:16:14+00:00Added an answer on May 25, 2026 at 3:16 am


    You could be wrong about `js/js.js`

    I’d suggest using Firebug and checking that you’re not getting a 404 error from your js file.

    You may have wanted to use a root-relative link to the js file: `/js/js.js` so that you don’t have issues with sub-directories.

    I’ve often professed the beauty of HTML CSS & JavaScript as an MVC pattern. So I wont go into that here, however. You should keep your HTML in .html files, your CSS in .css files, and your JavaScript in .js files

    Using inline javascript event attributes breaks the nice MVC pattern that I often describe, so it’s much better to attach the events in the script itself:

    //wrap this in a document.ready or window.onload event callback
    //-or-
    //place the script *after* the input element has been added to the dom
    var input;
    //replace with whatever selector 
    input = document.getElementsByTagName('input')[0];works
    input.onkeyup = function(){ loadStation(this.value) };
    
    ...more code...
    
    function loadStation(val)
    {
      alert(val);
    }
    

    Fiddle


    A couple more debugging questions:

    * Are you testing a flat html & js file locally?
    * Are you uploading flat files to a server?
    * Are you able to post a url of where the content is located?

    You’re using href instead of src on the script element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the top of my usercontrol: <UserControl x:Class=MyApp.Common.Controls.Views.SimpleView xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:Framework=http://www.memoryexpress.com/UIFramework mc:Ignorable=d
Here is a snippet of my JavaScript Code that I want to DRY up:
Here's my code to display some dialogs. #!/bin/bash output=$(zenity --list --text=Choose action --column= --hide-header
Here is my code, which takes two version identifiers in the form 1, 5,
Here's an excerpt from java.text.CharacterIterator documentation: This interface defines a protocol for bidirectional iteration
Here is a snippet of my form <form action= method=post onsubmit=return verify()> <input type=submit
Here is a shell script: echo Starting Jarvis Program D. ALICE_HOME=. SERVLET_LIB=lib/servlet.jar ALICE_LIB=lib/aliceserver.jar JS_LIB=lib/js.jar
here a a piece of code that is supposed to loop over and over
Here is my code: PtyView *v = [[PtyView alloc] init]; [v sendData([charlieImputText stringValue])]; in
Here is an example table: ID time data type 0 0100 xyz 0 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.