Text/javascript, Application/x-javascript, Difference?

Feb 19, 2007

two possibilities or the attribute type of script:

text/javascript (the one i usually use) application/x-javascript

what are the differencies between both?

depends on the html content?

for example html 4.0.1 versus xhtml 1.1?

View 12 Replies


ADVERTISEMENT

Javascript IE + Word.application

Jul 23, 2005

Is there any way for me to capture the DocumentBeforeSave event with an ActiveXObject("Word.Application") via Javascript in IE?

View 1 Replies View Related

Debug Javascript In A JSP Web Application?

Sep 29, 2005

Is there any way to debug javascript in a web application? When I
develop JSP pages, and it has the javascript code in it. The problem is
the debugger in Java IDE (WSAD in my case) can only debug Java code but
not Javascript code.

What should I do to debug javascript code?

View 2 Replies View Related

Using Javascript To Open An Application

Mar 27, 2001

I need to have a way to create a link that opens a specific word document.

How can I write a javascript function to do that?

View 6 Replies View Related

Analysing Flow Of A Javascript Application

Sep 8, 2006

My work is putting in a large application that is basically split up
between 30 or so Javascript files. I have some security concerns about
this application.

Basic security concerns is:

1. Possible SQL injection and other forms of injection attacks on URLS
of various server side components javascript accesses.

2. possible client side database access.

3. Incorrect use of http get for operations with possible side effects.

The security problems are probably relatively harmless. Mainly because
the application should be running behind firewall.

However I would like to have an analysis tool that can go over the
javascript code and allow me to see what urls are being called with
what parameters.

Javascript that writes new javascript into page (so I can get all
javascript files of application for analysis)

I know there are various javascript profilers and the like, anything
out there that helps in the analysis of this kind of application?

View 3 Replies View Related

Javascript Executing A Foreign Application Possible ?

May 4, 2007

I have an application in the form of "*.exe" file and i need to
execute this and evaluate the returned values within Javascript.

Is this possible ?

View 4 Replies View Related

How To Execute An External Java Application By Javascript?

Jul 23, 2005

I am writing a java application as a mozilla extension.
Because mozilla uses javascript for the frontend,
i need the javascript to call my external java application
and pass one parameter to it.

View 1 Replies View Related

JavaScript Date Difference, Accounting For Leap Years

Jun 19, 2006

I'm really sorry to post this as I know it must have been asked
countless times before, but I can't find an answer anywhere.

Does anyone have a snippet of JavaScript code I could borrow which
calculated the difference in years and days between two dates, and
takes leap years into account?

I'm calculating the difference in the usual way, i.e....

var difference = dateTo.getTime() - dateFrom.getTime();

....and converting this millisecond value into days by using...

var daysDifference = (difference/1000/60/60/24);

But how do I then display the difference in days AND years? I've tried
the following:

var yearsDifference = Math.floor(daysDifference/365.25);
var daysLeft = Math.floor(daysDifference-(yearsDifference*365.25));

....but it gives me inaccuracies. For example, if I use my code to
calculate the difference between 05/01/1998 and 05/01/2000 it returns 1
year and 364 days!

View 4 Replies View Related

Difference In Calling Javascript In Href And Onclick Of Anchor Tag.

Jan 18, 2006

I am looking for a generic javascript function to identify the form with in which a element exists, thus developer can avoid coding like document.forms[index].submit() - where they are sure, they want the form with in which this element exists is to be submitted. This way when forms are introduced at top level the code can remain unchanged, else every form introduce above in the DOM will result in increasing the index by one.

The code is given below. While doing so i am stuck with 2 problems
P1: In the code, you can see i am giving a explicit 'break' in the code. If i don't do so the code seems to be looping. Obviously i am missing some basic.

P2: I am able to pass 'this' for anchor element by name="xy"
<a href="#" name="xy"

in its onclick function by which, in the javascript function i move up the DOM.

While i am unable to do that on the anchor element given below since this function is now on the href attribute.

<a name="xy1" href="javascript:doFormSubmit(this);">Q test</a>

Hence the script fails. Code:

View 10 Replies View Related

Difference Between Class And Name Properties In HTML, As Applied To JavaScript

Dec 17, 2001

how the class attribute works in CSS: I can specify that every attribute with class="foo" be italicized with: .foo {font-style: italic;}

What if I want to do the same sort of thing in Javascript? Is there something built-in like document.GetElementsbyClass("foo").style = "italic" (I'm just making this code up of the top of my head, I don't know how javascript works.)

It seems to me that with JavaScript you're supposed to use the name="" attribute instead of class="". Why the diference?

I looked at webmonkey that had an article about this, but their writing style is simply confusing and I can't make heads or tails of their articles.

View 1 Replies View Related

HTML Application - Can Javascript Write To A Local Database?

Jul 23, 2005

IE 6.0 (not interested in other browsers at the moment)

I have looked everywhere I can find to look and googled until I am
cross-eyed and am hoping somebody knows what I'm doing wrong.

I have an HTML application (.hta) working fine, except one thing. I'm
trying to write to a local database from a .htm window (opened from
the main .hta window) and it doesn't work with any of the combinations
I've tried (and I admit to having tried a lot).

Here is one method I've tried:

strSQL = "Update myTable SET myField = 'myValue' WHERE myID = 12;"
var db = new ActiveXObject("ADODB.Connection");
db.Provider = "Microsoft.Jet.OLEDB.4.0";0
db.ConnectionString = "Data Source='c:myDirectorymyDatabase.mdb'";
db.Open;
db.execute(strSQL);

I can easily access the information in the myDatabase.mdb and display
it on the screen.

I can ask for updated information to be input on the screen.

But stuffing that updated information back into the database is the
problem.

Since I'm stuck in an .htm window, I don't have VBScript available, do
I? If VBScript isn't available and it isn't physically possible with
Javascript, then I'll have to revert to .hta windows, where I know I
have VBScript available. But I'd rather do it all in Javascript
within the .htm so as to avoid the security message that pops up when
the .hta opens a new .hta. For various reasons I don't think it is
possible for me to do this whole project within a single .hta.

View 9 Replies View Related

Trying To Use The GoTo Method Of The Word.Application ActiveX Object In JavaScript

Dec 11, 2006

I am trying to use the Goto method of the Word ActiveX object. I am
trying to open a document and go to a named bookmark. If I use this
code in VB it works, so I'm sure the approach is possible, I just can't
get JavaScript to work with it.

Here is the code I am using, the error I get from IE is Object
Expected:
Hope someone can help! Any help would be much appreciated

function PageLoad()
{
var WordApp = new ActiveXObject('Word.Application');
WordApp.Visible = true;
var documentlocation = crmForm.all.new_documentlocation.DataValue;
var wd = WordApp.Documents.Open(documentlocation);
wd.Select();
var Name = 'TestFred'
var wr = wd.Selection.GoTo(What : Word.WdGoToItem.wdGoToBookmark,Name :
'TestFred');
}

View 6 Replies View Related

Dynamically Writing Html/javascript From A Javascript Function

Jul 23, 2005

I'm working on some code and am running into brick walls. I'm trying
to write out Javascript with Javascript and I've read the clj Meta FAQ
and didn't see the answer, read many similar posts (with no luck
though), and searched through the IRT.ORG Faqs
(www.irt.org/script/script.htm).

The Javascript is designed to open an popup window and then inside that
window call another script which will resize that window. There may be
another way around this but the reason I tried this approach initially
was that I wanted to call the onload handler in the popup window to
resize the image only after the image had completely loaded. I've had
some code in the primary Javascript file (showimage.js) before that
works if the image has been cached but on the first load, it doesn't
resize properly which tells me it is probably because it is trying to
resize the window based on the image size but it isn't completely known
at that point. So I removed that code and tried placing the resizing
code in the second Javascript file (resizewindow.js). BTW I've tried
other code to open a popup image and automatically size it ie Q1443 at
irt.org but that doesn't do exactly what we need.

Even if there is another way to do this with one file, I still want to
figure out why this isn't working in case I run into it in the future.

I thought what I would need to do to use document.writeln to write
Javascript would be to escape any special characters and to break
apart the script tag ie

document.writeln('</SCRIPT>');

would become

document.writeln('</SCR' + 'IPT>');

I have a HTML page and 2 Javascript files. All files are in the same
directory and have permissions set correctly.

Here are the 3 files (keep in mind wordwrap has jacked up the
formatting):

index.html
----------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript1.1"
SRC="showimage.js">
</SCRIPT>
</head>

<body>
Click the house<BR>
<A ONCLICK="newWindow1('house1.jpg','Nice House')"><IMG
SRC="house1thumb.jpg"></A>
</body>
</html>


showimage.js
------------
function newWindow1(pic,sitename)
{

picWindow=window.open('','','width=25,height=25,sc rollbars=1,resizable=1');
picWindow.document.writeln('<html> <head>');
picWindow.document.writeln('<SCR' + 'IPT type="text/javascript"
LANGUAGE="JavaScript1.1" SRC="resizewindow.js"></SCR' + 'IPT>');
picWindow.document.writeln('</head>');
picWindow.document.writeln('<body onload="resizewindow();">');
picWindow.document.writeln('<img src=' + pic + '>');
picWindow.document.writeln('</body> </html>');
picWindow.document.close();
}

resizewindow.js
---------------
function resizewindow()
{
// Do resizing here.
// Right now this isn't being executed
alert("resizing window");
}


Can anyone provide some pointers as to why this javascript is failing?
I'm using IE6 on Win2k and when I click on the image to open the popup
window, it does open the window but it is white with no content and the
system immediately goes from about 4% CPU usage to 100% and
consistently stays there until I kill that window with the task
manager.

View 9 Replies View Related

Highlight Text With Javascript

Jul 23, 2005

Is it possible, using Javascript, to highlight (in yellow..) all the occurrences of "number: [0-9]+" (regex) of the document?

View 5 Replies View Related

Radom Text In Javascript

Jul 23, 2005

Well i have databse of quotes in TXT format i want the javascript which radomize that database meanseverytime when user come on my page then script ll pick up one sentence from data base and show it but i want diff sentence at each visit i have done in ASP i want that in JAVA script ...

View 4 Replies View Related

Text/javascript Obsolete?

May 26, 2006

I was browsing the w3c and saw that text/javascript for script "type" is obsolete. Is this true? And if so, what are we supposed to use instead?

View 1 Replies View Related

Does JavaScript Have <<<TEXT Analog?

Oct 15, 2007

I'm using PHP's <<<TEXT TEXT; a lot and I'd like to use something similar with JS. Is it possible? Does JS have <<<TEXT analog?

View 5 Replies View Related

Help W/ Fading Text Using Javascript....

Aug 29, 2002

What I'm trying to do is something similar to menu bar at the top of the page. Where it has Bio, Pictures, etc. I've searched the internet trying to figure it out and haven't had any luck.

View 7 Replies View Related

TEXT Formatting Using JAVASCRIPT

Jan 5, 2003

i am making a content manager, i want to be able to have the user format text with bold, italics, fontsize, color, etc within the text field window, kind of like the page here where we post topics and reply, any ideas where i can find any free scripts for this?

View 11 Replies View Related

Changing Text With Javascript/DHTML?

Jul 23, 2005

Is there a way to change the displayed text on a web page using some
combination of Javascript and DHTML? NOT in a text box. As far as I
know (with my limited knowledge) the only way you can do this is with
a textbox or images, which is not what I'd like to do. There's gotta
be a way to do this, right?

View 3 Replies View Related

JavaScript Marquee/Text Scroll

Jul 23, 2005

Does anyone know of a JavaScript that will do a marquee type text scrolling like the one on this page...

View 1 Replies View Related

Writing Out To A Text File With Javascript

Jul 23, 2005

What I want to do is create a HTML form that allows the user to enter data
into about 10 fields, and then based on the entered data, writes out data
strings to a text file. I am attempting to create a form for entering
simple rectangle CAD data via a HTML form, which will be written to a text
file, and then imported into a CAD program.

The form would contain prompt boxes for things like length, width, radius
size, step/repeat, etc. When the user hits the "SUBMIT" button, the data
strings would be written out to the filename the user specified. Below is
an example of data strings to be ouputted. Variables are &L, &W, &R,
&STEPX, &STEPY, &XN, &YN.

FRO 0 0 BY &L 0 ATT 1 POI 2
.........

View 3 Replies View Related

Text Formatting In Random Javascript

Jul 23, 2005

I'm going through some "learning by doing" of javascript through trial
and error, and admittedly have a lot to learn. But in taking various
scripts and dissecting them, I still can't figure out if what I want to
do is possible, and that is this:

I'm trying to include a paragraph on my page that is randomly chosen
each time the page loads. This I can do. But in this paragraph I'm
trying to include varied text formatting (parts bold, parts different
color, etc), and make part of it a link.

If I use unformatted, un-linked text, it works fine, but that's not my
goal. When I try including html in the items from which to be selected
randomly, whether by directly specifying the attributes or using CSS
class references, nothing displays, which makes me wonder what of all
this is the problem.

View 1 Replies View Related

Does Javascript Allow You To Obtain Selected Text?

Oct 31, 2005

I have a textfield and you of course you can select text...

When they hit the bold button I want it to obtain the selected text and
bold it, the hard part is trying to figure out if javascript can even
OBTAIN selected text?!?!

I can do this in java if I have to, I know java better than javascript,
it seems as that is the only way to do it from looking online.

View 3 Replies View Related

Displaying A Bold Text With A JavaScript

Nov 23, 2005

In HTML I use <b>...</b> to make parts of a text bold.
<h1 class = "Style-MyText">This text is normal. <b>This text is
bold.</b></h1>

Now I'd like to do the same with a JavaScript.
I tried
HTML: <h1 id = "MyID1" class = "Style-MyText">.</h1>
javascript: document.getElementById("MyID1").firstChild.replaceData(0,
document.getElementById("MyID1").firstChild.nodeValue.length, "This text is
normal. <b>This text is bold.</b>");

Unfortunately <b>...</b> is displayed as '<b>' and '</b>' and not
interpreted to make the text bold.
'View Selection Source' shows: This text is normal. &lt;/b&gt;This text is
bold.&lt;/b&gt;

Is there a way to make some parts of a text bold with a JavaScript?

View 5 Replies View Related

Javascript Copy Text Boxes.

Dec 13, 2005

I know this is probably a real simple one, but I'm obviously missing
something..

I'm building a function that I'll use throughout a website in the situation
that I have two text boxes - the two text boxes will generally contain the
same data. After the user completes the value of the first textbox, I want
to onChange the value of the first textbox into the second textbox UNLESS
the second textbox already has a value.

Here's what I've done so far...

IN THE HEAD
function CopyTextBoxes(TextBox1,TextBox2) {
if(TextBox2.value = '') {
TextBox2.value = TextBox1.value}
}

IN THE BODY WITHIN THE FORM
<input name="MailFrom" type="text" id="MailFrom" size="60" maxlength="100"
onChange="CopyTextBoxes('MailReplyTo','MailFrom')">
<input name="MailReplyTo" type="text" id="MailFrom" size="60"
maxlength="100">

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved