Javascript issue - help me please?

Hey! It aint that hard!

Javascript issue - help me please?

Postby xXJackXx » 11/10/09, 11:09 am



Site works fine in Firefox, doesn't work at all in IE (can live with that).....one piece of the code doesn't work in Chrome and I can't find a work around! This doesn't work in Chrome javascript:location.reload(true) well it doesn't work the way I've got it working in Firefox

This is how I'm using it:

Code: Select all
<script>
function update(string)
{
document.getElementById('content').innerHTML = string
}

var Home = '<object></object>'
var Forum = '<object></object>'
var News = '<P><object></object></P>'
var Events = '<P><object></object></P>'
var Calendar = '<object></object>'
</script>


Code: Select all
<ul>
<li><strong>File</strong>
   <ul>
   <li><a><span>Home</span></a></li>
   <li><a><span>Forum</span></a></li>
   <li><a><span>News</span></a></li>
   <li><a><span>Events</span></a></li>
   <li><a><span>Calendar</span></a></li>
   </ul>
</li>



And the part its loading into/refreshing is this....

Code: Select all
<div><php></div>


So it actually over writes whats in side that div but the reload call actually returns that div/object back to whats there.

In Chrome it just loads a white page into the space rather than refreshing the page.

I'd load ./sub/home.php into an object itself but I was running into issues with it there as an object and trying to load over the top of it.
Last edited by xXJackXx on 11/12/09, 12:49 am, edited 6 times in total.
xXJackXx
Member ****
 
Posts: 25
Joined: 08/07/07, 10:48 pm

Postby bob » 11/10/09, 4:07 pm

EDIT: erm the 'code' option doesn't actually let you put in code correctly! its trying to run the code stuff i put in by the looks of it -_


You can put it in the first time correctly, but if you go in and edit it, it'll make additional changes to it.
WYSIWTF
bob
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 7565
Joined: 12/03/01, 12:00 am
Location: St. Louis

Postby xXJackXx » 11/11/09, 1:39 am

bob wrote:You can put it in the first time correctly, but if you go in and edit it, it'll make additional changes to it.


Oh i see...

TEST

Code: Select all
<div><php></div>



Nope even on first post without going back in and editing it still stripped out a bunch of the code between the code tags.
xXJackXx
Member ****
 
Posts: 25
Joined: 08/07/07, 10:48 pm

Postby bob » 11/11/09, 2:08 am

Yikes....
Code: Select all
# -- Validate Inputted Data -->
      if ($lastname == "") {
         if (trim($name) == '' || trim($name) == "First Name" || eregi('<name><script>window.alert("There was a problem with your First Name.\nPlease check what you have typed and try again.");</script><php><script>window.alert("There was a problem with your Last Name.\nPlease check what you have typed and try again.");</script><php><script>window.alert("There was a problem with your E-mail Address.\nPlease check what you have typed and try again.");</script><php><script>window.alert("There was a problem with your Phone Number.\nPlease check what you have typed and try again.");</script><php><script>window.alert("There was a problem with your Comments/Questions.\nPlease check what you have typed and try again.");</script><?php
            $error_val = 1;
         }
      } else {
         exit();
Last edited by bob on 11/11/09, 2:13 am, edited 1 time in total.
WYSIWTF
bob
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 7565
Joined: 12/03/01, 12:00 am
Location: St. Louis

Postby bob » 11/11/09, 2:10 am

definitely fucked up.....
Last edited by bob on 11/11/09, 2:13 am, edited 1 time in total.
WYSIWTF
bob
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 7565
Joined: 12/03/01, 12:00 am
Location: St. Louis

Postby Gerry » 11/11/09, 3:47 pm

I saw this recently on the google maps group. I think it's very good advice:

http://groups.google.com/group/Google-M ... aps-API%3F
Gerry
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
 
Posts: 5727
Joined: 12/04/01, 12:00 am
Location: Perth, Western Australia

Postby xXJackXx » 11/11/09, 9:49 pm

Gerry wrote: I think it's very good advice:


Your right I should of posted a link to the site itself.

http://robcorp.pointzeroone.net/

The part that doesn't work is from the 'File' menu option and then 'Home'

Update: Worked it out, I was just being unco with the code and because it worked in FF I just rolled with it rather than doing it a smoother way. Well it reloads the whole page now instead of just the object area...will have to work on that.

So I've added a 'Chrome No work' menu so you all can see it not working ^_^
xXJackXx
Member ****
 
Posts: 25
Joined: 08/07/07, 10:48 pm


Return to Play With Code

Who is online

Users browsing this forum: No registered users and 1 guest

cron