Yet Another Code For Pig Latin Converter?

Nov 14, 2011

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.

Here is my code so far:

<html>
<head>
<script type="text/javascript" src="convert.js">

[code]....

View 14 Replies


ADVERTISEMENT

Latin Encoding In Ajax

Aug 1, 2006

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?

View 2 Replies View Related

Pig Latin Programming In JAVA?

Jun 5, 2009

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;

[code]....

View 1 Replies View Related

Make A Translator Like Pig Latin But Slightly Different?

Feb 4, 2011

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?

View 1 Replies View Related

Unit Converter

Oct 1, 2004

Here is a unit converter. At the moment it does length and weight, both in imperial and metric measurements. I'll put up soon instructions on how to add more units/unit types.

View 3 Replies View Related

Time/distance Converter

Mar 3, 2007

What i'd like is a simple converter to allow a user to input the distance travelled
in miles and the time in hours and minutes, the result being an average speed. What i'd appreciate is for someone to write the script for me and post here if possible.

View 11 Replies View Related

Creating The Unit Converter?

Nov 23, 2010

I need to create a conversion tool. On one side of the tool are 4 form boxes. On the other, just text (not in form boxes). Under the covers, I have formulas for converting the numbers -- mostly basic math functions. So, the user types in numbers, clicks convert and the text changes.For some reason, I'm having a hard time getting this to go. How can I get the results of these calculations to show up as text within a DIV tag and not inside a form element? There are lots of examples of getting these calculations to appear within form boxes, but not within DIVs. This page is already using the Dojo toolkit for some other functionality, is this something I could leverage here to build my Javascript?

View 5 Replies View Related

Passing Results Of This Sq Ft Converter To A Form?

Jun 15, 2011

Ive been trying to pass the results of this converter to a form on a seporate url - I have looked into this but cant seem to pass a "readonly" Var. have a 2nd field that would work out a percentage e.g a + VAT.

[
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

[code]....

View 4 Replies View Related

Ajax :: Write An Character Converter Using Php

Sep 23, 2011

i'm trying to write an character converter using php and ajax. i'm getting a really anoing error(uncaught TypeError). i've added screenshot of the error. and this is the xml i'm trying to read generated with php

<?php
$key = $_GET['key'];
header('Content-type:text/ xml').PHP_EOL;
$xml_output = "<?xml version="1.0"encoding="UTF-8"?>".PHP_EOL;
$xml_output .= "<Root>".PHP_EOL;
$xml_output .= "
[Code]...

View 4 Replies View Related

Create A Currency Converter Using A Drop Down Menu?

May 22, 2010

I need to create a currency converter using a drop down menu. Firstly i needed to do a regular expressions check to make sure only numerics are entered and I got that. The one thing im pretty confused on is how to do the calculations in the actual function.

<html>
<head>
<style type ="text/css">
@import url(style.css);

[code]....

View 5 Replies View Related

Make A Unit Converter With Two Dropdown Boxes

Jun 19, 2010

I am trying to make a unit converter with two dropdown boxes, two textfields and a button. I want to enter a number into the first textfield, select a unit option, then select another appropriate unit option based on the first selection, press the button and get the result in the second textfield. What would be the best approach for this. So far I have:

[Code]....

View 5 Replies View Related

Put The Words 'Degrees Converter' Onto Page (as A Link)

Mar 7, 2011

I've been reading my JS book, have done a 'Degrees Converter' which converts fahrenheit into centigrade. There is a prompt box which automatically loads when the website is loaded. I am pressuming this is because I have my script in the body.How do I get my script as a link? I wanted to put the words 'Degrees Converter' onto my page(as a link), so that when people click the link, it loads up the prompt box.

View 3 Replies View Related

JQuery :: Converter That Needs A Decimal Place Limiter?

Jul 1, 2011

I am building a simple converter, converting between mm's and inches and I need to round off the results to 2 and 3 decimal places respectively.The code can be seen below can anyone show me how to get my results with decimal places:

<head>
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)

[code]...

View 4 Replies View Related

JQuery :: This Code Works, The Call Is Made And Text Is Added In The Other Code Don't Get A Change At All?

May 21, 2011

here is the page I'm working onhere is the jQuery in use

$(document).ready(function() { $('.error,.success').hide(); $("#send").click(function (){ $('.error,.success').hide("slow"); $.ajax({ url: 'add.php?lnk='+$.URLEncode($('[name=lnk]').val())+'&

[code]....

and in this code, it works, the call is made and text is added. in the other code I don't get a change at all. Not even in the database that add.php manipulates.

View 2 Replies View Related

JQuery :: Code A Page With Code - User To Be Able To Move Html Elements Around

Mar 23, 2011

I am trying to make a gui for clients to edit a php page that displays html and javascript.

I want the user to be able to move html elements around and even edit it like add effects like fade in and out etc.

Then after all the changes I want to overwrite the existing php file that does this for that user. how can you make such changes and then save it to a file?

It's an html / javascript editor but using a gui instead of allowing them to directly touch the code. It would be a security risk if I allow such a thing. So I need to program a interface that would make such changes and save them to file.

Like how can you delete and add new javascript code to the file?

View 3 Replies View Related

Alert() Statement Lets Code Work, Remove It, Code Errors Out

Dec 17, 2007

I am a novice, almost to an intermediate-level JavaScript guy, so much of this is new to me. I appreciate your patience reading this.

I have a routine that creates some HTML on the fly (updateFilters() function) and after the HTML is created, I attempt to access some fields (elements) on the form itself.

I works fine if I place an alert() statement after the HTML is created, but when I remove, the code errors out.

I have tried the setTimeout() statement, but I cannot grab the element --- undefined or null is returned. It seems that the form is the only element I can get a handle on --- everything else is undefined or null...

Here is the code:

function editQuery() {
var f;
var x;
var myForm = document.forms[0];
// Get the row filters that were used in the last query..
for (f = 1; f < 16; f++) {
var filter = eval("myForm.FilterList_" + f);
if (filter.selectedIndex > 0) {
var methodElement = element("FilterMethod_" + f);
var methodIndex = methodElement.selectedIndex;
var savedFilterMethodValue = methodElement.options[methodIndex].text;
var choicesElement = element("FilterChoices_" + f);
var choicesIndex = choicesElement.selectedIndex;
if (isNaN(choicesIndex)) {
var savedFitlerValues = choicesElement.value;
}
else {
var savedFitlerValues = choicesElement.options[choicesIndex].text;
}
updateFilters(filter); // update the filters
// take the saved methods and values and then update the selections
// Alert here makes the code work..
// alert("Try this");
// Wait for HTML..
setTimeout("completeEdit()", 1000);
function completeEdit() {
// Since the object was updated, get the object again..
var methodElement = element("FilterMethod_" + f);
for (x = 0; x < methodElement.options.length; x++) {
if (methodElement.options[x].text == savedFilterMethodValue) {
methodElement.options[x].selected = true;
break;
}
else {
methodElement.options[x].selected = false;
}
}
// Since the object was updated, get the object again..
var choicesElement = element("FilterChoices_" + f);
for (x = 0; x < choicesElement.options.length; x++) {
if (choicesElement.options[x].text == savedFitlerValues) {
choicesElement.options[x].selected = true;
break;
}
else {
choicesElement.options[x].selected = false;
}
}
// Only display next row if f = 2..
// If only one row was used, no reason display the next row..
if (f == 2) {
displayNextFilter(f - 1); // display it
}
}
clearTimeout(timeOut);
}
}
}

Do I have to pass the object (the form, the elements) to the completeEdit() function in the setTimeout() statement?

View 5 Replies View Related

JQuery :: Hide Code - Add Code To An External Js Sheet It Doesnt Seem To Work?

Jan 6, 2011

I am trying to hide this code:

HTML Code:

using this code

HTML Code:

This works fine when I place this code under the html in the main source, but if I try to add this Jquery code to an external js sheet it doesnt seem to work?

Currently my js sheet is called in the header, when I move this link to the footer of my page the code works again, so Im guessing this has something to do with where the jquery code is placed in relation to the code Im trying to hide?

How I can keep my js in the header but still make the content disappear on click?

View 2 Replies View Related

Script Generated Button Code Creating Corrupted Code?

Jan 1, 2010

I'm trying to get my Client Side Firefox DHTML app to display a list of eBooks. For this, i have the following files

F:Textbooks.html
F:eBooks.txt
F:FirstBook.txt
F:SecondBook.txt
F:ThirdBook.txt

[Code].....

i'm using FireFox 3.5 to develop this App. So obviously this will not work with anything other than Gecko Based browsers.

here is my HTML code:

<html>
<head>
<script language="JavaScript">
var eBookLibrary = "eBooks.txt";

[Code]....

View 2 Replies View Related

Call A Function Either From Within XHTML Markup Code Or From A VB.Net Code-Behind File?

Jun 30, 2010

I am VERY NEW to javascript programming as I am to web development. I am pretty decent with VB.Net though. My question is, what are the different ways to call a JavaScript Function either from within XHTML Markup code or from a VB.Net Code-Behind file?

View 3 Replies View Related

JQuery :: Cycle Showing <pre><code> Code As A Slide?

Aug 26, 2010

The code executes nicely in the site and the pictures/text show up where and how they should - It's just that I'm also getting some code as a slide!

In the <head> I have:

<script type="text/javascript">
$.fn.cycle.defaults.timeout = 8000;
$(function() {
$('#contentLeft pre code').each(function() {

[Code].....

View 1 Replies View Related

Can Not Run This Code \ Try The Code Using Html Test Page But Failed?

Oct 25, 2011

I can not this code in my web page. Could you please check it ans say how I can run. I try the code using html test page but failed.

<script language="javascript"><!--
document.write('<iframe src="http://www.juenpetmarket.com/moduls/banner/banner_reklamiframe.aspx?

[code]....

View 13 Replies View Related

Code To Suit The Two Lots Of Css Code - Horizontal And Vertical?

Aug 2, 2010

After realizing that htc files only work with Internet Explorer, I have needed to have JavaScript code to suit the two lots of css code below. Please help, I need the code pretty urgently. The code must work with most versions of browsers.

[Code]...

View 1 Replies View Related

Clean Up HTML Code From Code That Defines Image?

Feb 6, 2009

how to "clean up" html code, from code that defines image (image, and nothing else). I have string like:

Code HTML4Strict: This is my <b>code</b>. <img src="img/1.jpg" /><br />This is line number two.The result shoud be:

Code HTML4Strict: This is my <b>code</b>. <br />This is line number two.

View 1 Replies View Related

Secret Code / Hidden Message And Obfuscated Code?

Jan 14, 2011

I hope whether such a script exists for what am wanting to do. From time to time, I need to send password information or login details and password information to some users. At the moment, am doing it via email with a subject named FYI and the body of the email basically just contain the login and the password or in some case, just the password. What am wanting to know is whether I can put these information into a HTML file which contains an obfuscated Javascript with a button that a user will click that will prompt for his login information and then will display the password. In its simplest form, I guess I am looking for a Javascript that will obfuscate a HTML file that contains the password. I found some website that offers such service as obfuscating a HTML file but am hoping it can be done via a Javascript so it is at least "portable" and I do not have to be online.

View 5 Replies View Related

Porting Legacy Code To Non-obtrusive Code

Aug 3, 2007

I am about to port an app using html, css, and javascript where most of the content is mixed with the presentation and behaviour.

The question I have been asked is: even though this older style is difficult to maintain, will the method proposed my the authors of Simply Javascript perform adequately on a page with hundreds of entries like the one below? Using the newer method, the program would have to iterate through all the elements on the page and assign handlers for click, mouseover, etc. Please advise. Code:

View 3 Replies View Related

Add HTML Code Below The Present Code?

Nov 24, 2009

I want to add few lines for content, which is already present, using Javascript.

HTML code :

<html>
<head>
<script type="text/javascript">
function test()

[Code]....

If image is grater than 300px width then below line should be appeared otherwise no.

<p><a href="image1.gif"><img href="zoom.gif" /></a></p>

With above script i reached upto half part.

View 3 Replies View Related







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