Ive got a really simple problem but I can't figure it out. I've got a
form named bob with one text box name bobtext with a default value of
"http://". When I add onload="document.bob.bobtext.focus()" it focuses
on the text box, but at the beginning. Is it possible to focus on the
text box, but at the end of "http://"? This seems like something easy
so I'm probably making some stupid mistake.
I'm currently making a web application which needs to be fully compatible with iPad. The functions I've implemented so far work perfectly on Firefox, Internet Explorer and other browsers. However, the iPad itself responds a bit different. After a certain action, I want to put focus on a textfield with the help of Javascript. Again, this works perfectly with the normal browser, the iPad browser however seems to be blocking the focus. The reason I'm not posting any code is because it's basically irrelevant. All I do is:
Is there a reason why setting focus to a textbox input, also gives focus to a submit button on the page, to where if you click enter in the text box, the submit button will be clicked.
The default behaviour of focus() method is displaying the cursor at start of the char(In FF focusOffset is 0(zero) and anchorOffset is 0(zero)). I need to display the focus at end of char after calling focus() method.
I think the problem is cause by my lack of understanding of how the browser (firefox 3.6.3) handles focus.A simplified version of my problem is:I've defined the function
function two_focus() { document.getElementById("two").blur();
Is there a way to set the focus on a form field without using focus()? I use ajax to build the form and if I try to set the focus using focus() an error is generate because of the form hasn't been built by ajax. So, it would be nice if I could set the focus() as I built the form.
Suppose I have a page, call in parent.html . Inside, there is an iframe, call it child.html . I want it so that in response to a keyboard event in either parent or child, child.html will respond in a particular way.
Do I need to use a different set of code for each html page, or can I reuse the same code?
If the code is different, what are the fundamental differences in code?
How do I make one frame respond to events in a different frame as a general rule?
#display { text-align:right; } </style> <script type="text/javascript"> var find=document.getElementById; var temp=0; var total=0; var which=0; var m=0;
function Mplus() { m=parseFloat(find('display').value) + m; find('memory1').value="M+*"; }
function Mclear() { m=0; find('memory1').value="M+"; }
I'm using XHR to make some REST requests. Right now I need to handle HTTP 401 responses.When a resource is requested such as a Javascript file or CSS file the browser will popup a prompt for username and password, which is normal behaviour.When I make an XHR request for POST,GET or PUT I get an XHR response which includes a status of 401 and no popup from the browser, this is also normal.The problem is when I make a DELETE request, I get the expected XHR response AND also the browser still pops up the username and password prompt.
Does anyone know of a basic Javascript Rich Text Editor that dosen't have too many features. I don't want smily faces or the ability to insert images, only the basic text formatting. All the ones i found on google are packed full of extras i don't need.
im need to create s simple CMS/WYSIWYG, but im not a pro on js. I found one on a website, but i dont want to resort to stealing codes.
basically, theres a textarea, where you put in text, and a button for bold, italics and underline, etc. if i highlight something on the textarea and hit the bold button, the text automatically gets surrounded by the <b></b> tags, or or whatevers convinient. when i look at the inline js code from the button, it calls a function, but id rather simplify the code, it should be something like onclick=insertstyle("b","textarea_name");
I have the source code to an old BASIC program that a friend of mine would like to run online. I am a beginner at JS, but I think that it would be a good choice for the project. My background is in C/C++ and web development.
Any suggestions that might get me off to a good start here? I can provide more information if needed, but I am not sure what would be helpful. The program is 550 lines in what appears to be BASIC and is a calendar conversion program. You give it a date and it will convert it into one of many other date reckoning systems (Gregorian, Hebrew, Egyptian, etc, etc).
I have a <FORM> with several text based input controls in it, and for some reason, although I have assigned ID values to these control, when I attempt to run any JavaScript error checking on them I get JS Error messages for some reason.
To simplify where I have gone wrong, I have written a simple JS alert message as follows...
I've been looking at all the various image replacement techniques..and they all seem unnecessarily complicated. I came up with:
function replaceLogo() { document.getElementById('header').innerHTML = '<img src="/images/logo-tci.gif" />' } It's just replacing the layer contents at a very basic level.
This works just fine, I'm just wondering how well supported it would be across different browsers. Anyone know of a table of browsers that support innerHTML or see potential cross-browser issues with this technique?
I would like to allow a user to browse his local directories, choose an image (probably .jpeg) file, and upload it to the server (a servlet). The same functionality that online datiing agencies use to let people save their photograph with their profiles. (My application is an online Want Ads.)
I feel that this must be possible within a minimal client (without a JVM) using nothing more than JavaScript, but I'll be damned if I can find how.
Would one of you more experienced JavaScript people please point me in the right direction.
In a nutshell, I'd like to have a list of items, each of which fills out a small table which displays some info about a particular item(the items being a trouble ticket for a tech support ASP-built web-based app). There may be zero, one, or many of these per ticket. Since some tickets have many of these items (call them work items), the page can get awful long. I have this part working already.
So my proposed solution to make the pages shorter would be to have one line for each of these little work items. If you click the text in that one line, it shows what had been a hidden div. If you click it again, it hides it.
Sorry I couldn't find appropriate group for SVG and ECMAScript. Since SVG is in XML format and ECMAScript is very similar to JavaScript. What's why I post in these two groups.
In the O'Reilly SVG book, in chapter 11 Animating and Scripting SVG. It mentions some very basic functions like
var circle = event.getTarget();
var obj = svgDocument.getElementById("idName");
I got error message said these are no a function in Firefox and batik-squiggle.jar
When I used SVGView plug-in (made by Adobe) for IE .
I typed:
var svgObject = evt.target; var svgDoc = svgObject.getOwnerDocument(); var svgElement = svgDoc.getElementById(idName); var svgStyle = svgElement.getStyle(); svgStyle.setProperty('stroke-width', 3);
These lines are working fine for SVGViwe Plug-in by not work for Firefox and batik. They complained that getOwnerDocument is not a function. I tried to change getSVGDocument but no luck.
Is that O'Reilly book too old? Its first editoin is 2002.
How can I make getElementById() working in Firefox and Batik? Is there some examles or some documents?
I'm about to embark on really learning jQuery. The first step of which is to get a basic jquery function to work. Everytime I learn something this way the first thing does not work for no apparent reason. It's probably something obvious but I can't move on without getting this to work. I added jquery to the page I have two things a div called #content-container and an image with class .logo
I'm including jquery.ui.datepicker.css and jquery.ui.all.css versions 1.8.7 in my header, when I click the input box firebug shows the datepicker code is in the source but the ui-helper-hidden-accessible class isn't being removed to display the datepicker. Do I need to update jquery or at least ui.core which is 1.7.2?
After playing with the css files I was able to get the datepicker to open but the prev and next text is being displayed above the prev/next buttons
I've tried every combination I could with these files to get a basic datepicker to open up
I've got the following code block in one of my pages ...
<?php if ($config->theme->short_name == 'default') { ?> <script type="text/javascript">
[Code]...
Shouldn't the code above set the .html property of the element with class "error_box" to the specified text? I've tried using an id instead of a class i.e. $('#error_box").html(...) but that doesn't work either. I've also tried using the .text() method.
Manually using document.getElementById("error_box") works without any problems - it's only jQuery that won't do what I tell it. :-)
A client of mine is trying to integrate one of his Web systems with my system. In an essence, he wants to embed my system's web UI into his "master" web page, and display it in a sub-frame whenever a user requests my system display.My system (JBoss AS) has Basic Authentication enabled. So if a user attempts to access my system he/she is prompted to provide username/password. If correct credentials are provided, then user is allowed access to my system / web pages.Now, the client is trying to automate the login. He wants to provide the login information automatically, through JavaScript in his master page (this is needed so that users of his system don't provide any credentials - all user/pwd information is passed under the curtains).What is wrong in the approach above and do you know if there is a better way to properly implement this seamless logging (knowing that Basic Authentication is the only option)?
I have been trying all morning to put a basic slideshow into my site from the below link[URL]... am pretty new to this and having to host my images on Photobucket as I use Big Cartel. I cannot figure out where to put the image links and do they need -
I'm trying to create a script which allows multiple different tables to be shown on mouseover of an area (in this case, a table cell). However, I want the tables to appear in a long list for those who have JS disabled. For obvious reasons I don't want two copies of the tables in my html, and obviously only want the mouseover section to appear for those with JS enabled.
The basic problems I have so far is that I can't get the div "plaintables" (which contains all the tables) to be hidden when JS is enabled, and when I mouseover (activating scim()), I get the message [object HTMLTableElement] rather than the actual table.
Pretty much just starting out with Javascript, so this is probably something really simple I have done wrong.
Just incase it matters, I don't have access to the contents of the <head> tag (This is for a site with an existing template) - it would be easier if everything could be done in the <body> section.