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

  • Home
  • SEARCH
  • 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 3671324
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:28:23+00:00 2026-05-19T02:28:23+00:00

My app is supposed to draw a grid over an image and provide you

  • 0

My app is supposed to draw a grid over an image and provide you with the coordinates of that grid. This however does not seem to work in I.E., Safari, and Firefox when the image is hosted on my local machine. When I host the photo on Picasa the images show up fine. This is working in Chrome. The images will eventually be hosted on my server but I am working with it locally first. I am really new to this. Any help would be greatly appreciated. Thank you

Here is the HTML and javascript I am using:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
<meta charset=utf-8 />
<title>Grid test</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<link rel="stylesheet" type="text/css" href="css\grid_style.css">
  <img src="c:\EA_A02_N_1-4_5mM_Xgal_7d_B.cropped.resized.grey.png" id="img"/>
  <script>
  function SetGrid(el) {
  var size = el.getSize();
  var coord = el.getCoordinates();
  var gridTable = new Element('table', {
    'id' : 'gridTable',
    'styles' : {
      'position': 'absolute',
        'width' : size.x,
        'height' : size.y,
        'top' : coord.top,
        'left' : coord.left
    }
  });

  var numcols = 48;
  var numrows = 32;
  var cellSize = {
    width: size.x / numcols,
    height: size.y / numrows
  }

  for (var row = 1; row<=numrows; row++){
      thisRow = new Element('tr', {
          'id' : row,
          'class' : 'gridRow'
      });
      for(var col = 1; col<=numcols; col++){
          thisCol = new Element('td', {
              'id' : col,
              'title': row + ' x ' + col,
              'class' : 'gridCol0'
          });
          thisCol.inject(thisRow, 'bottom');
      };
      thisRow.inject(gridTable, 'bottom');
  }

  gridTable.addEvents({
    // Add the click event to the gridTable
    click: function(e) {
      // Do something with the grid position.
      alert(Math.floor((e.client.x - coord.left) / cellSize.width) 
            + ', ' + Math.floor((e.client.y - coord.top)/ cellSize.height));
    }
  });

  gridTable.inject(el.getParent());
}


window.addEvent('load', function() {
    SetGrid($('img'));
  }
);</script>

</body>
</html>​
  • 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-19T02:28:24+00:00Added an answer on May 19, 2026 at 2:28 am

    It’s probably a security “zone” related problem. Browsers tend to be picky about allowing javascript from external URLs run alongside code that reads things off the local disk for fear of leaking confidential information.

    Does it work if you host all the javascript locally too?

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

Sidebar

Related Questions

I am developing an app which supposed to work on devices that have OS
I've got an iPhone App that is supposed to send POST data to my
This app displays a form with a textbox where the user is supposed to
I have a widget that supposed to call an Activity of the main app
I'm writing a mobile marketing app, which is supposed to work on both iOS
This is a program I'm writing that's supposed to display some text in a
I have this app of mine that contains a section that will allow the
I'm developing an iPad app that supposed to output a website to another view,
I have an app that is supposed to change its language without having to
I've got an app that's supposed to use some shell commands to copy a

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.