Creating A Function That Will Translate?
May 25, 2009Write a function translate() that will translate a text into "r�varspr�ket". That is, double every consonant and place an occurrence of "o" in between.
View 3 RepliesWrite a function translate() that will translate a text into "r�varspr�ket". That is, double every consonant and place an occurrence of "o" in between.
View 3 RepliesI need to translate the messages of mine scripts, as I can make
professionally this working with the pair php and javascript?
I have 2 functions in asp that I need translated to javascript
the first checks that there is no email in the textbox. the second checks that there is no phone number code...
After i setup a module for the Google Translate for my site:[url], I found [url]
then i change the code little bit:
First it was :
Then I made it as:
But still i've 1 error:[url]
I need to translate this php code in javascript if possible:
<?php
function ShakeIt($string)
{[code].....
The main one I find is to use translate to move the canvas around, which just seems odd to me. I don't even fully understand how it works. But the one I was looking at used clearRect. In examples given looked as though it had to redraw the canvas every frame. I'm just mucking around with a simple poker game, figured I'd have the table in one layer and anything that moves on a top layer? By doing that I could only clear each card as it moved around...yes?
View 8 Replies View Relatedfunction snippet that would take a date like 14-04-2009 and translate it into a Julian date? This is what I have so far, but it doesn't give the correct result:
[Code]....
I have alot of home videos I want to put on my website, and it seems that the easiest way to do it would be to embed it onto my website using HTML script. Problem is, I have no clue how to convert in into HTML scrip
View 3 Replies View RelatedI'm trying to create a function in JavaScript using Dreamweaver8 such that when a user hits the ' F1' key when a text box is selected a separate "pop-up" window will open, with text of my choice.
Does anybody have any pointers or even some source code? I use ASP on my server.
I've been trying to create a function that creates objects and another function that can delete them when triggered the objects code is generated server side and triggers the function passing the object data. The object data sort of looks like this
<OBJECT id="RandomNumbers" width="0" height="0"
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
[Code].....
I've tried a few methods I looked up but whenever I try to get them to work the way I need them they throw errors... It would be very cool if you could also get it under a div tag.
I came across Marijn's helper function again called forEach. It does just what it sounds like it does, and is one of those things one would consider adding to their own personal little library like getElementsByClassName...My question is, I've heard/seen that Mozilla (and only Mozilla at this point) indeed HAVE a forEach function, and I do most of my beginning testing in a recent-stable Mozilla browser, so I'm not 100% sure but I think the Mozilla forEach might work... what happens if I write my own and I keep the name?
So if there's some default forEach that the browser natively understands, and then I have a function in my lib that has the same name, does mine take precedence over the native one, or not? Is it just safer giving libraries slightly weird names so new in-built functions can't possibly interfere?So also, if later browsers end up implementing the newer Javascript (2?) that as I hear, will implement a getElementsByClassName, would this break, or ignore, everyone's pre-made getElementsByClassName, assuming they are called the same name?
I am trying to create a function that adds to specific array, then
checks the array to determine whether to alert 'Yes' or 'No'.
Note this is a simplified version of the function I have created. This
function will be used with different arrays.
function change_value (check_value, array_name, array_number){
if (check_value == 'yes'){
array_name[array_number]='Y'
}
else{
delete array_name[array_number];
}
// check if there is a 'Y' anywhere in the array
if(array_name.length>0){
alert('Yes');
}
else{
alert('No');
}
return array_name;
}
I was wondering if it is possible to do something like the following:
$
(
'div'
)
[code]....
Basically I often want to be able to directly start using the $(this) selector without having to use an existing function like .each().
I am trying to create a function that takes a users input in the form xx/xx/xxxx. Then I need to figure out a way to compare to a new date and give which day of the year it is when using: alert("This is the" +foo+ "day of the year."). Im alittle confused on how to take the users input and compare it somehow to give me the day of the year.:cool:
View 3 Replies View RelatedHow can I create a function that takes optional arguments?
View 7 Replies View RelatedI'm having trouble with something that I can't explain outside of an example. Code:
Code:
$js_info_tabs = json_encode($valid_array);
$script = <<<JAVASCRIPT
<script type="text/javascript">//<![CDATA[
function changeTo(id) {
[Code]....
I have the code this way in order to consolidate it since I would prefer to do that instead of checking the selected ID and manually checking against all possible IDs (which works flawlessly, it just takes up about 5x the lines and is not modular). What I have above also works, but there is one fatal flaw:
It seems like the anonymous function that is the onclick for each unselected element becomes "return changeTo(tab + '_id')", but I don't want it to be that. I want the argument to actually be what tab is instead of the variable.
What ends up happening is that after changeTo() is called for the first time, any element you click will result in the last element being the selected one, as if it's using the final value of tab as its return value.
This doesn't make any sense, though, since tab is local, and deleting it before the function exists doesn't work. Deleting elem at the end of the for loop doesn't work. I honestly don't understand what's going on or why it doesn't set the new onclick value correctly.
Basically I just want changeTo(tab + '_id'); to turn into changeTo('MYID_id'); instead, but it simply doesn't do that and I can't figure out a way how.
I would like to store a variable then call it back later. I have a variable on line 198
www = ''+this._ad.clickUrl+'';
And on line 321 I try
document.write(www);
I've tried so many different options, just won't work. I have even tried to call document.write(window.www);
The code is below.. might be easier to read on [URL]
Code:
<html><head>
<title>Integrated Ad Sample</title>
<!-- NOTE MANDATORY jQuery Include -->
<script type="text/javascript" src="[URL]">
</script><!-- Integrated Ad Include-->
<script type="text/javascript"> .....
Is it possible to create URLs from function call operators?
For example, I'm trying to program an onClick function which will load a
webpage in one frame and an image in another, based on the name of the
button which is being clicked. So clicking the button with name="help" will
open "webpages/help_page1.html" in one frame, and "images/help.jpg" in
another.
To do this I was hoping that the following would work, where the function
had been called by
function activate(buttonName) {
webpageURL="webpages/"+buttonName+"_page1.html"
imageURL="images/"+buttonName+".jpg"
parent.frame1.location.href=webpageURL
parent.frame2.picture.src=imageURL
}
But this doesn't work, because the browser (IE6) looks for
"webpages[object]_page1.html" and "images[object].jpg".
creating a function which does the same thing for the chosen elements.I have #design1 #design1servicetext and #design1servicebutton.
//Service hover//
$('#design1').mouseenter(function (){
$('#design1servicetext').css('background-position', '0 -91px')[code]....
How can I create a function, in which I have to choose 3 divs to do the animation?
A function like ,animatebg('#design1','#design1servicetext','#design1servicebutton');
I create an iframe in script and load it with this code.
[Code]...
This should force the loading of the savepages.php file. In that file I do an echo to verify that it is called.
[Code]...
The objective is to call that php function. The javascript function is called. I don't know if the element is actually created. Unlike php javascript doesn't put anything in the source for us to verify. I don't have ajax. How can I make the javascript function call create an element that loads the php file and causes the code in that php file to execute.
I am creating a game which will need to create arrays and store variables for thousands of different users. I have created about 15 functions that will need to store their changes to variables so that the game can progress.show me a simplistic way to store a variable altered or created in a function longterm?
View 1 Replies View RelatedI want to learn more about creating functions for element events
without having to put onclick event in every tag. For example:
<script>
document.getElementsByTagName('input').onclick = function () {
alert('hello');
}
</script>
Now, I know the above does not work as I have tried it but hopefully
the idea of what I am trying to achieve here. Basically for every input
tag, when the user triggers the event (click) it will do the same
function.
Anyway, I would more so like to learn about this type of scripting
where you assign functions to events. However, I dont know what to
search for in google and the like. Where could I learn more about this?
I'm very new at this. I'm using jquery within wordpress and I've created an image slideshow with captions. It worked fine. Now I want to include a slide counter. I followed the example here as best I could: [URL]...
This is the code I have:
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j('#ng_slideshow').cycle({
[Code]...
All the function extending I see extends on an _object_. I want to extend on a string.
/**
* Returns a slug version of a string
*/
jQuery.extend ({
slug: function( text ) {
return text.trim().toLowerCase().replace( /[^-a-zA-Z0-9s]/g,'' ).replace( /[s]/g, '-' );
}});
I want to be able to do something like:
$('#form_element').val().slug();
The above does not work. I even tried modifying the 'trim' function in jQuery core to include the rest of the enhancements, but it didn't work.
I have 3 button controls on my asp.net web page. This r html controls one of them I have set to default on form load. Using javascript how do I set the other 2 button to be clicked when it has focus & enter key is pressed.
View 4 Replies View Relatedi am having a problem creating a javascript function to swap my radio values based on the first set one.
i have a bunch of radio buttons on the page which are like this:
Code:
<input type="radio" name="add_id[1]" value="yes" CHECKED>Yes <input type="radio" name="add_id[1]" value="no">No
<input type="radio" name="add_id[2]" value="yes" CHECKED>Yes <input type="radio" name="add_id[2]" value="no">No
etc.... and each one is different, related to an input field, and as you can see it is a radio input array, and all radio inputs are named add_id[1], add_id[2], add_id[3] and so on i want a javascript function that will swap all the values of these radio buttons to whatever the first on is set to, either 'yes' or 'no' Code: