473,385 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Javascript: Object doesn't support this property or method

Hi everybody,

Problem with dragging effect of resizing is working but having problem with setting a flag to determine if mouse button is click or not. Is there anyone knows how to fixed this? I used several ways to do this as shown below, all telling me the error below. I used IE 6 w/ SP1.
The error comes from onmousedown"mousedown()".


Error message:

Microsoft JScript runtime error: Object doesn't support this property or method


Approaches made:

[HTML]var mousedown = false;[/HTML]

inside mousedown,

[HTML]mousedown = true;[/HTML]

inside mousemove,

[HTML]if (mousedown)

{

....

}[/HTML]


Partial Codes:

[HTML]
<head>
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
var lLeft = 0;
var lTop = 0;

var mousedown;

function mouseDragImage(obj)
{
....
var dLeft, dTop;
var ev = window.event;

// if (window.event.button == 1)
// if (ev.button == 1)
// if (mousedown)
// if (mousedown == 'true')
if (mousedown == 1)
{
if(ev.pageX || ev.pageY){
newx = ev.pageX;
newy = ev.pageY;
}
else
{
newx = ev.clientX;
newy = ev.clientY;
}

.....
}
}

function mousedown()
{

// mousedown = 'true';
// mousedown = true;
if (mousedown != null || mousedown > 0)
{
mousedown = 1;
}
}

function mouseup()
{
// mousedown = 'false';
// mousedown = false;
mousedown = 0;
}


.....
</script>
</head>

<body>
<input id="Text1" type="text" /><br />
<img id="Img3" name="Img3" src="images/rock.jpg" onmouseover="mouseOver(this)" onmousedown="mousedown()" onmousemove="mouseDragImage(this)" onmouseout="mouseup()"/><br /><br />
<input id="Button1" type="button" value="button" />

</body>
[/HTML]

den2005
Jul 14 '06 #1
5 70684
iam_clint
1,208 Expert 1GB
you might try a on mouse down and on mouse up such as
onmousedown="mousepress(0);" onmouseup="mousepress(1);"
var mousestate
function mousepress(state) {
mousestate = state;
}
Jul 14 '06 #2
rpjd
25
you might try a on mouse down and on mouse up such as
onmousedown="mousepress(0);" onmouseup="mousepress(1);"
var mousestate
function mousepress(state) {
mousestate = state;
}
Hi, I'm having this problem with getElementBy********
I have an xmlhttprequest call which works as far as
Expand|Select|Wrap|Line Numbers
  1. something = http.responseText.split("||");
  2.  
the request is calling a php script which queries a database giving me two variables $numfields and $numrows, and two arrays, array1[] and array2[][], self-explantory. When I try to assign the two variables using getElementByName, or when I try to assign either array using getElementById I get the same error "Object doesn't support this property or method"
Expand|Select|Wrap|Line Numbers
  1. numrows = result.getElementByName("numrows").innerHTML;
  2. numfields = result.getElementByName("numfields").innerHTML;
  3. array1 = something.getElementById("array1").innerHTML;
  4.  
All my text fields have ID's. Does anyone have any insight into this?

RPJD
Apr 14 '07 #3
acoder
16,027 Expert Mod 8TB
Hi, I'm having this problem with getElementBy********
I have an xmlhttprequest call which works as far as
Expand|Select|Wrap|Line Numbers
  1. something = http.responseText.split("||");
  2.  
the request is calling a php script which queries a database giving me two variables $numfields and $numrows, and two arrays, array1[] and array2[][], self-explantory. When I try to assign the two variables using getElementByName, or when I try to assign either array using getElementById I get the same error "Object doesn't support this property or method"
Expand|Select|Wrap|Line Numbers
  1. numrows = result.getElementByName("numrows").innerHTML;
  2. numfields = result.getElementByName("numfields").innerHTML;
  3. array1 = something.getElementById("array1").innerHTML;
  4.  
All my text fields have ID's. Does anyone have any insight into this?

RPJD
Post your HTML code (your text fields).
Apr 16 '07 #4
when using getbyName your text field must have name
and when using getbyId ur text filed must have an id

Sometimes only one of them working somtime both depends on the browser mode
Oct 21 '10 #5
just use single quotes instead of double quotes,

Wrong
something.getElementById("array1").innerHTML;
Right
something.getElementById('array1').innerHTML;
Nov 14 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Olaf | last post by:
I have a frameset page witch contains the myFuc() function. The function is accessed from a page in one of the frames in the frameset. An example is shown below. <input...
3
by: news.onetel.net.uk | last post by:
I and my friend Karl have spent literally all day trying to find out what is causing my error but we are zapped of any further functionality :) I have a form that adds news records. You select...
5
by: John Olbert | last post by:
Subject: Error is Object doesn't support this property or method I am trying to pass a C# string under Vs2005 (Net2) to an Vb6 ActiveX Control. I get the following runtime error-- "Object...
1
by: punjab_tom | last post by:
hello i have a problem when it comes to running my intranet site.. it gives msgbox in internet explorer saying 'object doesn't support this property or method' and line 260.. I identified line...
2
by: Charles | last post by:
I have a validation script used before submitting a form. When executed it says "Object doesn't support property or method". I'm using onclick="return validate();" which should be fine. But when...
1
by: hhackwell | last post by:
Hi guys, I'm running a simple piece of Javascript on my website to allow users to make an object appear when they want to use it. It works fine but I keep getting this error on IE and although...
1
by: pankajprakash | last post by:
Hi, I have an asp.net application and I have used Ajax. I have implemented the function in code behind and calling in the javascript function during the form load time then it shows the "Object...
2
by: simeric | last post by:
Hi all experts, I've "object doesn't support this property or method" error when running a Javascript on Internet Explorer 8 This is the statement that is having the error:- ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.