I have to develop a program for translating a word in english into pig latin, I have most of it done, it runs but I can't make it define if the first letter see if it's a consonant or not, if it's a consonant take the consonant out and put"ay" at the end and if it's not consonant just put the "ay" at the end of the word, and it has to give an error message if user puts in more than one word, it's done in 2 classes, been stuck on this for hours now have done a lot of research but seems like everyone is doing a more advanced program. Here's my program:
First class
public class piglataintran
{
private String translate;
I am trying to fill a dropdown menu with ajax, but the table contains latin characters. In mozilla i get a weird black character instead, and in internet explorer the whole code breaks because if a word ends in a latin character then it ignores the <bri put on the end, therefore affecting my data logic.
I am using results = http.responseText.split("<br>"); as a delimiter.
Is there a way to fix this without resorting to using xml encoding?
I have to convert english to pig latin for an assignment. I am having trouble with my code.The assignment is that I have 2 separated functions on a page - one that does an individual word only and the other that will convert a whole phrase.I am getting error messages but I cannot figure them out. I guess I have banged my head against the wall too many times to count over this code.
I have developed my own fake language like pig latin but ever so slightly different, I want to make a translator for it as there are so many for pig latin,english-my language:
1: put the first letter at the end (hello becomes elloh) 2: put an 'a' 2 letters in (elloh becomes elaloh)
obviously if the inputted word had a capital letter at the begining, then the new first letter should be in capitals, and the translator should be able to translate whole sentences not just word by word,I have downloaded countless javascript/html files for pig latin translating because obviously the first step for translating to the 2 languages is the same and ive managed to stop it adding the 'ay' or 'way' to the end of the word as it is in pig latin bu i dont think ive done it very efficiently?
I am trying to program a script that will output the solution for the towers of hanoi problem, the only problem is that it will not output the solution it just hangs while calculating. Code:
In some pages of my website I use a code like the following:
for (var n = 0; n < getTagsArray("SPAN").length; n++){
//SPAN is just an example. I also use other tags tag = getTagsArray("SPAN")[n];
//make something with tag... }
function getTagsArray(Tag){
if(document.all){ //Internet Explorer return document.all.tags(Tag); } else if (document.layers){ //Netscape eval("return document.tags." + Tag); }}
I want to put all browser-specific code inside the getTagsArray function. So far, I've programmed only for Internet Explorer (my browser), but now I want to make my website visible to all browsers. I'm not sure about the getTagsArray function. Is it right or is there a better way to do the same thing? And how can I extend that function to make it work in other browsers?
Finally, where can I find some information about cross-browser programming? I have the javascript reference for Internet Explorer and Netscape, but I know nothing about other browsers.
I just released javascript lib that really helps to develop robust and clear js-scenarios following the OOP directions. The library is compatible with wide range of browsers on different platforms, including Netscape 4.x, Netscape 6.x, Netscape 7.x, Opera 6, Opera 7, Mozilla 1.0, IE 4, IE 5, IE 6.
The documentation on e.g. the fadeIn() method does not specify any constraints on the callback argument. Does that mean that 'anything will work'? Specifically, is recursion allowed?I want to know whether jQuery design has deliberately taken this into account. Yes, I can read the source code. No I don't plan to do so (for now), since I consider it an essential gap in the documentation.[code]
I am trying to make a round corners script in object oriented programming method. This is purely for learning purposes.
The script is no where near complete but I am already having problems with it.
I am trying out the techniques described in 'David Flanagan ' text book 'JavaScript: The Definitive Guide, 5th Edition'
This code is called from html page which once working will place a round container around element
The selector parameter in Custom_rounded_container function is defined because only the else part of the if statement in Custom_rounded_container is executing. I put this in because few people at other forums thought the problem was because of the selector parameter being undefined.
Trying to figure out OO programming for JavaScript and I'm totally lost.
Here's what I'm trying to do:
I'm posting search data to a PHP form to run a query on a database.
The structure is sort of like this:
So I'm thinking I need to create search objects or arrays. Initially, I thought I could do something like this:
Code:
This doesn't seem to work. It says object not defined whenever I try to do something.
I've also tried creating a JSON object like this:
Code:
This will allow me retrieve the data like I want to:
Code:
The problem is I can't figure out how to add data to the JSON object without manually typing it in. I need to be able to loop through form elements on my HTML page and set them to these variables. I'm using jQuery and doing something like this:
I am making a php/mysql epos system for my shop which will be run from a browser on my shop PC. I have large buttons which I would like to be able to 'click' by pressing something like the F-buttons at the top of the keyboard. Is it possible to override the standard button shortcuts for a web page. This is only going to be on my shop computer so accessibility is not a problem.
I have a bunch of .js files that I insert into my my html file using the <script> tag, and this works just fine. The .js files contain info about the menu, table set up, etc. and take care of the page format.
But now, I have a tidbit of Javascript in an htm file, and this tidbit opens up a new window with some information on it. I want to insert all of the menu and format javascript files on this new window that it opens. so, my question is: how would I do this: (since this doesn't work!)
I have a drop down field that is dynamically populated using an XML sheet that looks like:
Code:
I populate the dropdown box using javascript that looks like this:
Code:
My the drop down form looks like this:
Code:
When a user clicks on the drop down box, all of the values inside "<title>" tags get displayed. Once the user has made their selection, the form is submitted and posts the user's option. My problem is that when the user clicks on the drop down box, I want them to see the content included in the "<title>" text but I want the form to post the data included in the "<xml>" tags.
For example, if the user clicks on the drop down menu and selects the option 'Animals' I want the form to post 'xml/animals.xml'. Any ideas how to handle this?
I have been creating a webpage and I have added some buttons via frontpage and linked them to another page, the thing I cant figure out is how to add commands like a javascript button to enable a smaller window, no toolbars, no scroll bars etc.
is there any way i can make the buttons so when they are pressed a window opens with my dimensions etc?