|
Hi all,
I am getting this quite an unusual error in my JavaScript script.
What i am trying to do is to increase the height of a DIV named as f4 as follows:
var z = f4.style.height + 22;
f4.style.height = z;
As soon as the second line is executed, i get an error in the browser which says "Invalid Argument" and the height remains unchanged.
Initially i thought that this was happening because i did not mention any height attribute. But it is occuring even after providing the same.
I am really confused.
Any help will be highly appreciated.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
-- modified at 13:21 Monday 10th April, 2006
|
|
|
|
|
The height attribute is a string value, that may contain something like "100px". If you add the value 22 to the string, the value will be converted to a string, and the result will be "100px22". This is of course an invalid value.
Keep the height you want in a variable, and use that variable to produce a value for the style by adding "px" to it (or any unit you like).
---
b { font-weight: normal; }
|
|
|
|
|
Hey Guffa,
You are great man...
I dont know how you always come to my rescue, be it C# or JScript.
That solution indeed solved my problem.
Can you please help me out in one more thing.
Well, i continued making my script and found one strange thing.
I have some DIVs, and their heights are being set by a CSS class. Now if you try to retrieve the height of any of the DIVs, the value returned is blank. I mean nothing is returned. Say, i tried:
alert(f4.style.height);
and this returned a blank alert.
Just before this statement, i added a:
f4.style.height = 22px;
then when i tested, the alert showed the height as 22px.
Is this behaviour normal, or am i going wrong somewhere ?
Please help.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
It's normal. The style that is set using a CSS class is not stored in the style property.
You can use the currentStyle property to get the actual style that is the composite of default styles, css styles and inline styles. It's not part of the standard DOM, though.
---
b { font-weight: normal; }
|
|
|
|
|
Guru,
you are simply marvellous.
That indeed helped.
Thanks again.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
hi, i am doing a project in jsp. but i'm not able to find any good books for jsp. pls suggest some good books or any free e-books which can be downloaded.
thanks
|
|
|
|
|
Hello,
I read about the automatic update Microsoft was to install on April 11th but decided to delay. I understand ActiveX, Flash, and Java applets will be affected by this in that you have to manually activate them before they are usable.
Does the same apply to .NET controls being embedded in a web page? How will those be affected, if at all?
Thanks,
Hashir
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
I want Uploaad a file on host with condition from localost.
Can you help me ?
|
|
|
|
|
With condition? What do you mean by that.
And what part is cousing your troubles?
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi,
Is the javascript code used to create an IFrame correct?
The script is typed in a seperate javascript file and asp.net(vb) code will call the javascript method.
The script below is supposed to display an IFrame on the webpage when the webpage loads.
function showIFrame()
{
var iframe = document.createElement("iframe");
iframe.id = "testiframe";
iframe.name = "testiframe";
iframe.frameborder = 1;
iframe.style.top = 100;
iframe.style.left = 100;
iframe.height = 185;
iframe.width = 175;
iframe.style.position = "absolute";
iframe.style.display = "block";
iframe.scrolling = "auto";
iframe.src = "C:\Test.html"
window.document.body.appendChild(iframe);
return false;
}
However, there is no IFrame displayed when the page loads.
Is there anything wrong with the jscript above?
|
|
|
|
|
|
Hi,
I am developing a web site in ASP.
The problem is simple.
In the Login page I am displaying two text box for UserID and password respectively. One Submit button and one reset button.
Once User enters his ID and Password, User has to click the submit button.
On the FORM's action method I am providing another asp page.
But before request is send to server I want to valid the data entered in the text boxes when User clicks submit button.
How can I do that?
Every thing will come to you if you have faith.
|
|
|
|
|
|
|
can spmebody pls advice me how to fire IHTMLSelectElement onchange event in mfc...i tried IHTMLWindow2 execscript......... but this does not work since the javascript function uses this pointer
|
|
|
|
|
All~
I know this is a longshot but...
Here is what I have:
- Our App which captures info out of another 3rd party app.
Here is what we are looking to do:
- Our customers all use another 3rd party based web form which needs the same data which our app is already capturing. They would like to be able to use our app to prepopulate the fields in the web form (so they don't have to manually enter all the data and/or paste it into the individual fields.). I know there must be a way to do this since I have seen Nortons Password Manager do the same thing (capture and save my frequently used form data and then populate 3rd party web forms on the fly for me).
Any Idea's or methods from the Guru's greatly appreciated!
TIA,
Don
__________________
Don Schnell
Sr Production Engineer
Tools For Education, Inc
|
|
|
|
|
|
Hi All,
In javascript there is function print() to print HTML page. But I want to print in landscape mode. Is there any function to setup print page in javascript?
I need your helps!!!!!
Thanks
Thai Nam
|
|
|
|
|
|
Thank for your help!
Could you please send me document about "ScriptX Basic"?
|
|
|
|
|
I know that this is the right place to ask: How to make my www.google.com to speak English?
Now it speaks German, although my Windows is English. On my laptop Google speaks German, on my desktop it speaks English like it should. I tried with Regional settings - no help.
Any ideas?
Doctor Celic
|
|
|
|
|
Try http://www.google.com/en
Nrupesh V Soni
|
|
|
|
|
In my Webservice i need to use an active x component(for e.g a.dll). The component is installed on the web server which host my web service. The component is internally calling another active x component (for e.g b.dll) which resides on the application server. When I execute the web service it give me an error saying cannot find b.dll. I am able to do the same in ASP environment and its working fine. I search the help document provided for b.dll and it says the probable reason might be due to the user not having access on the application server. a.dll provides an help method which returns user name used to call b.dll. I tried the same in asp.net environment it returned the user name as "ASPNET". where as in ASP environment it returned the user id setup in the IIS server.
|
|
|
|
|
ASPNET is the default user to access files on behalf of the client. By default the ASPNET user account has limited access to files especially out side of the scope of an ASP.NET application. You will need to give ASPNET "Execute" access on the .dll in question.
|
|
|
|