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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:32:59+00:00 2026-05-15T19:32:59+00:00

i’m using the following code to submit a form: function submitfilter(){ alert(in here); var

  • 0

i’m using the following code to submit a form:

function submitfilter(){
 alert("in here");
 var o = $("#opentimes").val();
 var p = $("#price").val();
 var d = $("#distance").val();
 var t = $("#type").val();
 $.post("eateries.php", { opentimes: o, price: p, distance: d, type: t }, function(data) { $("html").html(data); } );
 return false;
}

i’m running this from eateries.php, so as you can see i want to reload the same page (like a regular form submit does). everything is working fine except that some of my CSS isn’t working. specifically:

body{font-family:Arial, Helvetica, sans-serif; font-size:14px; margin:0px;color:red;}

the rest of the CSS seems to be working fine. what’s going on here??

edit: another thing i should probably mention is the CSS does work for a second.. while that alert(“in here”) is up (the text is Arial and red). however, after i hit “Ok”, the font goes back to black serif.

thanks.

edit: here’s the head section as requested.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<title>Eateries Gadget</title>
<link href="styles.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
//alert ("you're using "+navigator.platform);
if(navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
 //alert("it's an iphone!");
 $(function(){ 
  $("body").css("font-size", "16px");
/* $("#footer").css("background-color", "blue");
     $("#footer").css("position", "static");*/
   $("select").css("font-size", "16px");
  $("input.btn").css("font-size", "14px");
  }); 
};

navigator.geolocation.getCurrentPosition(foundLocation, noLocation);

function foundLocation(position)
{
 var currLat = position.coords.latitude;
 var currLng = position.coords.longitude;
 //alert('Found location: ' + lat + ', ' + lng);
}
function noLocation()
{
 alert('Could not find your location.');
 var currLat = null;
 var currLng = null;
}

</script>

<script type="text/javascript">


function submitfilter(){
 alert("in here");
 var o = $("#opentimes").val();
 var p = $("#price").val();
 var d = $("#distance").val();
 var t = $("#type").val();
 $.post("eateries.php", { opentimes: o, price: p, distance: d, type: t }, function(data) { $("html").html(data); } );
 return false;
}


 function setstate(opentimes,price,distance,type){
  for(var i = 0; i < document.filters.opentimes.options.length; i++) {
   if(document.filters.opentimes.options[i].value == opentimes){
    document.filters.opentimes.selectedIndex = i;
    break;
   }
  }
  for(var i = 0; i < document.filters.price.options.length; i++) {
   if(document.filters.price.options[i].value == price){
    document.filters.price.selectedIndex = i;
    break;
   }
  }
  for(var i = 0; i < document.filters.distance.options.length; i++) {
   if(document.filters.distance.options[i].value == distance){
    document.filters.distance.selectedIndex = i;
    break;
   }
  }
  for(var i = 0; i < document.filters.type.options.length; i++) {
   if(document.filters.type.options[i].value == type){
    document.filters.type.selectedIndex = i;
    break;
   }
  }
 }
</script>

</head>
  • 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-15T19:33:00+00:00Added an answer on May 15, 2026 at 7:33 pm

    You are replacing the innerHTML of the <html> tag in the callback to the $.post! If you use firebug, you might notice that the body is disappearing all together.

    A quick fix would be to target $("body") instead of $("html") in that $.post callback. Otherwise, make another element to populate with the return of that callback.

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

Sidebar

Ask A Question

Stats

  • Questions 467k
  • Answers 467k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem is that the compiler usually creates an operator=… May 16, 2026 at 2:09 am
  • Editorial Team
    Editorial Team added an answer You can use DIR recursively. The output of dir is… May 16, 2026 at 2:09 am
  • Editorial Team
    Editorial Team added an answer You cannot add HTML-ified items to the menu. Menu-items are… May 16, 2026 at 2:09 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.