|
Hi all,
I am using a firefox plug in called Live HTTP Headers.
Right now I am trying to filter only left the URL Address and time.
Can anyone help me?
Then convert it back to XPI format.
Need help in it.
|
|
|
|
|
Is this in any way connected to this[^] question?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I want to read the Javascript method body
how could I do this, could u refer me few links
Thanks
SaiNath
|
|
|
|
|
You want to read the code which is inside the {} of function?
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
Are you saying you want to read the method body?? I don't see why you would want to do that, but this link might be useful - http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256BF8004D72D6[^]
This one loops through all properties in an object passed and you could modify this method to find out the contents of your function alone. Out of curiosity, if you don't mind, what is this for?
Cheers,
Karthik
|
|
|
|
|
function func(){
alert('1');
}
document.write(func);
try it! moocr.com
|
|
|
|
|
Is it possible to call a method of jar file which is residing in Client side, through java script. this is required to access USB port for testing tool development.
Here is give a simple example to help me with code snippet.
A simple Java program (simple.java) which has two methods GetName() and GetID() which returns string and integer value respectively. which is then converted to jar(simple.jar) and placed in C:\Temp\simple.jar.
Can some one help me in java script code snippet, how to call the jar file inside my html file, and how to access the GetName() and GetID() method.
Note: Simple.jar file will be at client machine and NOT at server side, may be i have to learn how to use plugin to download simple.jar from server to client (will be happy if i get some pointers on this too!)
FYI, I am newbie to javascript.
|
|
|
|
|
if dont consider the safe or you browser allow, you can do it use javascript.
but you'd better dont do this operation.
moocr.com
|
|
|
|
|
Thanks for your reply... at last some one is hearing me !
Well.. I am developing a tool which is very internal to our office.. a web access to one of the hardware which is connected to com port. Got a jar file with the hardware which shall be used to connect the hardware through comport. I dont have the source of the jar file.
So, i am not worrying about the security and whether it is feasible etc.
I would appreciate if some one can give the solution.. for the problem i posted.
There is some guy who developed hardware is giving the jar file.. think he had lot of trust with Java language growth!
|
|
|
|
|
Would really appreciate somebody taking a look at this:
http://www.codeproject.com/Messages/3618419/Newbee-Javascript-ASP-SQL-Lookup-Issue-Please-Help.aspx
Sorry if it's the wrong section, but i'm not sure if it's a problem with the ASP or Javascript.
|
|
|
|
|
The error message you show indicates an error with the ASP code.
It's been so long since I ussd classic ASP that I can't really remember it all now, but two things jump straight out from your code:
Having already set:
set objRS = Server.CreateObject("ADODB.Recordset")
you should not be setting it again on line 18 (where the error is)
set objRs = connString.Execute(mySQL)
So try rwemoving the "set" keyword from that line.
Also.. shouldn't you be closing your database connection at some point..? (That's a rhetoric question btw - you should be!)
Do you really have to use clasic ASP? Move on to .NET if you possibly can.
|
|
|
|
|
Thanks so much for your response, I fully intend on moving into the correct decade with .net, but i'm very new to web development and it's a bit of a learning curve even with ASP & Javascript. I will get there...
I have been through the code as you suggested and i'm still having problems, I simply need an asp recordset into a javascript array. Maybe i'm just too tired, but I just can't get it right.
Message: Object expected
Line: 14
Char: 1
Code: 0
URI: http://localhost/floorfurnishings/autocompleteactive1.asp
Line 14:
objRs_cmd.ActiveConnection = MM_floordb_STRING
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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">
<!--#include file="Connections/floordb.asp" -->
<%
Dim arrPDFs
Dim javascriptArrayValues
Dim objRs
Dim objRs_cmd
Dim objRs_numRows
Set objRs_cmd = Server.CreateObject ("ADODB.Command")
objRs_cmd.ActiveConnection = MM_floordb_STRING
objRs_cmd.CommandText = "SELECT * FROM dbo.Companies"
objRs_cmd.Prepared = true
Set objRs = objRs_cmd.Execute
objRs_numRows = 0
Function GetPDFsArray()
If NOT objRs.EOF OR NOT objRs.BOF Then
GetPDFsArray = objRs.GetRows()
Else
GetPDFsArray = ""
End If
End Function
'Get array
arrPDFs = GetPDFsArray
If isArray(arrPDFs) Then
for i=0 to uBound(arrPDFs,2)
javascriptArrayValues=javascriptArrayValues & """" & arrPDFs(0,i) & """" & ","
next 'i
javascriptArrayValues=Left(javascriptArrayValues,Len(javascriptArrayValues)-1)
Else
javascriptArrayValues = "Error: No results for array"
End If
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<%Response.Write(mySQL)%>
<input type="text" name="pdfDesc" id="pdfDesc" autocomplete="off" />
<script>
customarray = new Array(<%=javascriptArrayValues%>);
actb(document.getElementById("pdfDesc"),customarray);
</script>
</head>
<body>
</body>
</html>
<%
objRs.Close()
Set objRs = Nothing
%>
Thanks again.
|
|
|
|
|
Well, I can only assume thet the error on line 14 is related to something inside your include file "Connections/floordb.asp"....
Honestly, you will find it an easier learning curve to use ASP.NET. You can get all the development tools you need for free from here[^]. You will also find far more (useful) articles and help avaialable online.
[edit] btw, you have only closed the recordset, not the database connection (still).
|
|
|
|
|
... this is how I used to connect to databases using classic ASP:
Dim db, rs
Dim sql, r, i
' On Error Resume Next
Set db = Server.CreateObject("ADODB.Connection")
db.Open Application("dbConnect")
' Application("dbConnect") is database connection string, and defined in global.asa,
' but you can insert the connection string here isntead if you want
sql = "select ... whatever"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, db, 3, 1
' ... do whatever
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
used to work for me!
|
|
|
|
|
I can't believe it, when I re-wrote the page to clean it up I forgot to add the include files.... All working now.
Thanks again, and I will defiabtely look at .net.
Cheers,
Overtired Idiot.
|
|
|
|
|
Paul Hayman wrote: Overtired Idiot
We've all been there...
|
|
|
|
|
i want to show the percentage..but its not working plz tell the mistake
<html>
<head>
<script type="text/javascript">
function marksheet(sub1,sub2,sub3,sub4,sub5)
{
var sub_marks=parseInt(sub1)+parseInt(sub2)+parseInt(sub3)+parseInt(sub4)+parseInt(sub5);
var percentage=(sub_marks/500)*100;
return sub_marks;
if (percentage >= 50 && percentage <= 59)
{
document.write("You have got "C" Grade");
}
else if (percentage >= 60 && percentage <= 69)
{
document.write("You have got "B" Grade");
}
else if (percentage >= 70 && percentage <= 79)
{
document.write("You have got "A" Grade");
}
else (percentage >= 80 && percentage <= 100)
{
document.write("You have got "A+" Grade");
}
}
</script>
</head>
<body>
<script type="text/javascript">
var biology=prompt("Please enter marks of BIOLOGY", "");
var chemistry=prompt("Please enter marks of CHEMISTRY", "");
var pak_studies=prompt("Please enter marks of PAKISTAN STUDIES", "");
var sindhi=prompt("Please enter marks of SINDHI","");
var english=prompt("Please enter marks of ENGLISH","");
document.write("Total Marks Obtained Out Of 500 are: " + marksheet(biology,chemistry,pak_studies,sindhi,english));
</script>
</body>
</html>
|
|
|
|
|
The problem lies in the document.write statements where you write the grade out. You have unescaped quotes in there, so you need to escape them, e.g.:
document.write("You have got \"C\" Grade");
|
|
|
|
|
Is there not also a problem with the final "else ..if" clause? Can you have a qualifying statement on a (final) else clause without an "if" there? That last clause should be the catch-all, wihtout any qualifier... surely...? I can't see how his code will produce the desired output all the time...
|
|
|
|
|
You also need to return from your function after your if..else.. statement. Currently, the function will return without executing that portion. You will never get to your document.write statements.
|
|
|
|
|
Since you've already gotten some answers, I'll just point out a few items that may improve your coding. These are general solutions - the can be language and implementation specific.
For conversion to %, you'd (potentially) improve your accuracy by multiplying by 100 before dividing by 500. This is true if the math is done as integer math. The first division, by 500, will truncate values, which, when you multiply them, will be lost data. Although this is negligible in the this exact case, it can cause problems when the calculations aren't quite so clean. It is often the case (for floating point calcs) that multiplication by 0.1 is faster than division by 10.0.
Your many write() statements could be, perhaps, changed to assignments to a string, with only a single print statement. You could take it a step further and even simply assign a single letter to the string and use a formatted write() statement. Assignments are usually easier to understand (and have less internal overhead) than function calls. Again, you code is simple, but this could become a consideration as you create more complex apps. This also might be a matter of taste.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
hi!
I uses javascript code for adding TR with respective TD on arrowKey press.
But my problem is that my code is working properly on IE but not work in Firefox.
I don't know why.
Please guide me on this.
thanx And regards,
|
|
|
|
|
Well if you want help you might start of by posting the code that isn't working as well as what firefox is reporting as errors in the error console.
Without that we can't do much, we aint mindreaders.
|
|
|
|
|
hi!
I want to add new cell in page through javascript.
my query is: when i press tab button and when tab button reaches on last cell , the new cell has been added
please help me.
thanx & regards
|
|
|
|
|
What have you got so far? When you say new cell, do you mean you want a new TR with relevant TD items in it? The basics of adding the row are covered here[^].
|
|
|
|