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 7672021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:11:26+00:00 2026-05-31T16:11:26+00:00

Greetings from some noob trying to learn JQuery, I am attempting to make it

  • 0

Greetings from some noob trying to learn JQuery,

I am attempting to make it when you type something in a box below a div layer it reloads that layer upon submission of the form with a php get of the text box in the form. Expected behavior is it would reload that box, actual behavior is it don’t do anything. Can someone help me out here…. Below is the code.

<div id="currentwxdiv">This is where the new stuff happens
</div>
<form name="changewx" action="/">
<input type="text" id="city">
 <input type="submit" name="submit" class="button" id="submit_btn" value="New City" /> 
</form>
<script>
  /* attach a submit handler to the form */
  $('form[name="changewx"]').submit(function(event) {


    /* get some values from elements on the page: */
    var $form = $( this ),
        city = $('#city').val()

    /* Send the data using post and put the results in a div */
    $('#currentwxdiv').load('http://api.mesodiscussion.com/?location=' + city);
    return false;

  });
</script>

Its giving the Javascript Console Error Error….

“XMLHttpRequest cannot load http://api.mesodiscussion.com/?location=goodjob. Origin http://weatherofoss.com is not allowed by Access-Control-Allow-Origin.”

  • 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-31T16:11:27+00:00Added an answer on May 31, 2026 at 4:11 pm

    You are using POST method? is impossible to post to an external url because with ajax, the url fails the “Same Origin POlice“.

    If you use GET method, is possible to do that.

    Another solution is to make a proxy. A little script that recive the params and then… using CURL or another thing you have to post to the external URL… finally, you jquery have to do the post thing to the proxy:

    For example:

    $.ajax({
      url: '/proxy.php?location=' + city,
      success: function(data) {
         $('#currentwxdiv').html(data);
    
      }
    });
    

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

Sidebar

Related Questions

Greetings, I am trying to perform a copy from one vector (vec1) to another
Greetings, I'm trying to find a way to 'unbind' a socket from a particular
Greetings! I am trying to check directory write-permissions from within a Windows MFC/ATL program
Greetings! I'm trying to have a UIWebView controlled from generated events. Is there a
Greetings, I'm going to get exif info from some images using android. I know
Greetings everyone: I would love to get some information from a huge collection of
Greetings All; I have a LinkedList of type String which contain some words like
Greetings all. I need to get some opinions from those outside of my work
Greetings! I've been trying to display some HTML with Java using JEditorPane . But
Greetings, I have some List of objects of Type CMessage. CMessage can look as

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.