Javascript Square Root
Dec 12, 2006I cannot manage to do a square root operation. I am using the coding:
var a = Math.sqrt(b);
I cannot manage to do a square root operation. I am using the coding:
var a = Math.sqrt(b);
I have an html that has a form for example
<form method=post action=blah.html>
<input type=hidde name=myHiddenVar value=''>
blah blah blah
<iframe name=myiFrame frameborder=0 scrolling=no src="anypage.php">currently loading</iframe>
</form>
now in iFrame page (anypage.php) I want a button to control or SET the value of the main FORM (html page) and its variable myHiddenVar, for example here is what I tried and it didnt work...
in anypage.php I hade a button
<input type=button value=change onClick="javascript:parent.myHiddenVar=100">
but the aboue didnt work, is there anything like docuemtroot ?
I have a problem with an application i'm working on (Asp.net using
vb.net for developing). I'm normally used to doing middle tier
development, so my javascript skills are not up to par. Here is my problem:
I have a javascript file called 'PMP/Scripts/Popups.js' (pmp is the root
of the website). In that file is the following function:
function OpenTutorial(sTutID)
{
var sURL = '../support/tutorials.aspx?tutid=' = sTutID;
var sProperties = 'center:yes;etc..'
window.showModalDialog(sURL, self, sProperties);
}
where ../support is acutally pmp/support.
Most of the website pages are located in sub folders from the root of
the website. When editing is to be done on a record, a popup window is
called from the main page. the popup pages are in another sub folder
(i.e. pmp/review would be where review.aspx resides and the edit page
would be located at pmp/review/popups). We give the user a tutorial
icon to click on which calls the OpenTutorial function on a button click
event.
The problem is the tutorial popup page won't load properly when called
from another popup page. I've tried variations of location.href,
location.pathname, location.hostname etc.. but can't seem to get the
pages to open correctly. The most common error i get is that the url is
not correct. here is a sample of the urls being called by the function:
I code with javascript in ruby on rails. So I need to switch between localhost and my website. So the domain changes every time. What can I do, so that javascript grabs the root domain, so, lets say: Code:
View 2 Replies View RelatedI have the following script using the closet method. It works fine for the inner most li tags however the outer li tags don't get seen? So both Root 1 and Root 2 don't get selected but the Sub Cat 1 and Sub Cat 2 get selected fine. I'm sure I'm missing some code to make this work.
[Code]...
Well, it's been a while since I last visited CF, but I'm finally back and, for the life of me, am drawing a total blank on something that seems like it should be fairly easy to handle.
The Math.sqrt() function works just fine if all a person needs is the Square Root of a number, but what about needing the Cube Root or even a 4th Root of a number?
My first instinct was to use the Math.pow(x,y) function with a negative value for "y." For instance;
var z=Math.pow(27,-3)
This should return a value of 3. Unfortunately, this doesnt seem to work when I tested it through the W3 reference pages, so I am looking for a clue as to how I might go about finding such values, or if it is even possible through Javascript.
jQuery is ignoring the root element when passed through context. Am not sure if this is intended behavior.[URL]
View 7 Replies View RelatedI am using a dhtml "Image Slideshow", and I was really happy with I customized its layout to my needs, and it runs perfectly on FF and on IE (wich is very important for me, since in my country most of people still use IE). Check it hereHowever, when I insert the slideshow in my design, it stops working on IE (working in perfection on FF):I am using the original slideshow file in an iframe.(before I tryed to paste the code directly into the page, but it didn't worked, so I thought using an iframe would work, because the code of the original document would be intact)
View 5 Replies View Relatedi want to make a module to swap ads randomly from folder named �ads� on the root like,, the advertising are either .swf, or .gif all that i need is to play the swf (when one is finished it starts the other one.. till the display of all swf's)..
[URL]
The folder �ads� is supposed to have 5 ads, when it finished number 1... it start randomly until it finish displaying all the advertising swf... i dont want to display only one of the five ... but display all in a random way..may be i have to know the length of the swf (in seconds ) and when it is finished i want to display the second and third .... etc
I have what some would identify as a Kiosk machine running a browser in full screen(true full screen, no address bar visible). It serves as an internet cafe machine, with unique users and a login system.
What I'm looking to do is when the user leaves the root site (via clicking a button), to embed a frame at the top of the page with an address navigation bar, so I can track the time the user spent browsing. I'm exclusively using firefox, and I'm not concerned with support for such functionality in other browsers.
I assume I can achieve this with javascript, jquery, or ajax, I'm just not sure which to start with and how to begin planning the execution.
I have the following code:
function createSquare(event) {
var x = parseInt(event.clientX);
var y = parseInt(event.clientY);[code].....
This shows me a square and a select but the select isn't populated with anything.i do have a form later on down the page. The form code is (which I try and pull in the info from the select in the form in the select in the createSquare:
<form action="" name="tag" method="post">
<input type="hidden" name="picture_id" value="4">
<select name="tagged_person" id="tagged_person">[code]....
I'm hoping that someone can help me with a question I have about javascript syntax.
I got an html page that uploads an image and some text field to a database.
What I'd like to do is modify the content of one of the textfields prior to it being submitted to the database. Specifically, I need to append the contents of one of the fields to another.
The problem that I've encountered is that the textfield name contains square brackets , ‘extra_fields[Price]'
I've identified the square brackets as being the problem by changing the textfield's name to one that doesn't contain square brackets ,extra_fieldPrice for example and the script works fine.
Unfortunately, in the real world application of this page, I can't change the textfield name.
The specific part of the html page that's giving me problems is:
I know very little about javascript, but was wondering if something like this can be done?
Would it be possible (with mootools or jquery) to have homepage that will rotate its home page content forwards and backwards based on either triangle or square? ie, you can rotate through 3, 4, etch home pages?
Sort of like a slider, but it rotates off a center axis of the triangle or square?
getting an empty square character instead of a space.Looks ok printed by php.It seems to happen after I use rubout or delete and then type a space in my JS editor; when the edited text is displayed via ajax in a JS tooltip, I see an empty square.Hundreds of articles have this problem so I need a way to remove them. Iv'e tried various character replacements but can't seem to determine what the square character is (char code).
View 2 Replies View Relatedi want to update several Textboxes by reading the value of another Box. For that i use the following small script:
<form name="form1" method="POST">
<input type="text" name="xx" value ="1"
<input name="tex1" type="text" size=16 maxlength=80 value="1">
</form>
Everything works fine, but for my PHP-Script i need square brackets [
]. If i try to add them, my Script got an error:
<form name="form1" method="POST">
<input type="text" name="xx" value ="1"
<input name="tex[1]" type="text" size=16 maxlength=80 value="1">
</form>
Whats wrong?
While trying to get a selector to work with ids that include square brackets, I searched the forum and found that I needed to escape the brackets with '\'. However, while this works with my fiddle: can't get the exact same selector to work within my page in either FF or Safari. I've triple-checked the id and it is correct; I know that jQuery is working on the page because changing the selector to$('.nameinput') gives the expected results. can't change the id because I'm working within an existing application; I know I could add a class to the input and use that as the selector instead. I'd prefer not to and would just like to figure out why this isn't working.
View 1 Replies View RelatedI do undersand the basic notation of jQuery selectors, but I don't understand what the [0] means in the following code snipet:
$("body").append(
$([
overlay = $('<div id="lbOverlay" />')[0],
[code]....
I am trying to make a hollow square for loops this is what i got but i dont want my loop to go infinite i just want my loop to stop after first time.
<html>
<head>
<script type="text/javascript">
var squareSize;
[Code].....
Basically what I need to do is take a number of elements, lets say 6 in this case, all of which are div's with an image child e.g.
<div class='triangle-element'>
<img src="../images/face.jpg" />
<div>
I have been looking for days for a way to do this but have made no progress.
The text looks fine in php but when displayed by javascript, some of the spaces are shown as an empty square symbol.
I have tried the following to change any unusual character to a space, but it doesn't help. code...
I believe that the character is created by a javascript-based editor when either the delete or backspace key is used to make an edit.
I have this strange symbol in many articles so I need a way to deal with this (the articles display fine when displayed by a php CMS).
I'm using javascript to show a preview of the article as a link tooltip.
Can't figure out why the pattern will match a period but not a square bracket.For example, it will match "See Jack run." but not "See [Jack] run.". Just ignores the brackets.
Code:
var title = note_title.value;
// validate periods and brackets
[code]....
I am adding code to a SharePoint 2007 list where I want a calculated field to be a colored square based on a status column.I have all the code I need to create a colored round bullet, but I would like the bullet to be square or a rectangle.I was not able to find a repalcement for the "bull" in the below code.
arr[i].innerHTML = "<DIV title='Long Term Focus' style='font-weight:bold; font-size:24px; color:green'>•</DIV>";
how do I get the post data from html in jQuery which contains square brackets?
[code]........
is possible with JavaScript to drag and drop a .jpg from your desktop to a small square box on you website. On drop the picture has to upload the file and store it on the server.
View 2 Replies View RelatedI was just looking a the Battleship game by Jason Hotchkiss Is there a way to modify the Javascript so that you can display the ships in square blocks (3X3, 2x2 These could be bases etc.) rather than lines (1x3,1x4)
View 3 Replies View Relatedmy javascript does not working after I retrieve a record that contains square symbol in the database. The square symbol should be a newline in a textarea. This is how the record "looks" in the table: [URL]
I am inserting the record using ASP and the value with square symbol is the value from a textarea with newline/enter. After that I retrieve the value using ASP and pass it to javascript and then the page is not working. If I retrieve other record which contain no square symbol then the script is working.