Putting Factors Of X Into An Array
Mar 12, 2011
I need some help putting the factors of a number (y) into an array.For example if y = 20: [1, 2, 4, 5, 10, 20]Once I have this, I can use it to factor a quadratic:(ax = c)(bx = d)if c = 3 and d = 5 then I could check if 1c was a decimal, if 20d was a decimal and then vice versa.Basically, I can use these numbers to see if b or d is a whole number and if it isn't, try the next one.If none of them are, then I can do y(ax + c)(bx + d)
View 4 Replies
ADVERTISEMENT
Mar 30, 2010
I was wondering if it is possible to put all the non null variables of an array into a string variable with spaces between each array value? For example, if array() is a text array and has 10 values, array(0) through array(9), with three of those values null, let's say array(3), array(5), and array(7) are null, is there a way to put the remaining seven values into a string variable with spaces between each array value?
View 2 Replies
View Related
Mar 30, 2011
I have been tearing my hair out with this for the past 12 or so hours and am no closer to a solution than when I began.
I have a jquery function to dynamically create <li> tags for an unordered list:
$(function() {
var idealist = $('#idealist');
$('.checklist').click(function(event){
item = '';
[Code].....
This is working fine. The problem is I need to somehow pull the ids from each <li> tag into a string or an array that can be made available somehow to php code for further processing. I can create the string or array within my jquery function but can't figure out how to make that available to php.
View 10 Replies
View Related
Mar 10, 2011
Basically I want to factor a number and select the two closest numbers to the middle of the factors for example: 20 factors to 1, 2, 4, 5, 10, 20 I want it to return 4 and 5 If the number is has an odd number of factors (has to be a perfect square) I want it to select the middle number and say it twice for example:
64 factors to 1, 2, 4, 8, 16, 32, 64
I want it to return 8 and 8 Would I use an array or what? My code should probably look like:
[Code]....
View 21 Replies
View Related
Mar 13, 2011
Im using Google Maps and when the user moves the map I have an event listener to return a string of routeIDs that are within the bounds of the map.Later on in the page I have a PHP MySQL statement where it Has [ICODE] SELECT * FROM routes WHERE [ICODE] , and after the WHERE I want to add this string.Basically as the user moves the map around, the list of available routes in bounds should change.How can I do this without redirecting pages at all, as that destroys the functionality of the google map?
View 1 Replies
View Related
Jun 2, 2011
I am using DOM table insertrow as such:
Code:
var _table = document.getElementById("TableList").insertRow(0);
_table.border = 1;
var cell0 = _table.insertCell(0);
var cell1 = _table.insertCell(1);
[Code]....
but it does not seem to work. how to get a border on the individual row?
View 1 Replies
View Related
Mar 18, 2010
I have a link and i am putting the id in href.
Code:
<a href="12345" id="myLink">link</a>
In IE 8.0.6 and 6.5 (not my machine but on coworkers machine) when link gets clicked, i get full path including the ID like "http://www.domina.com/folder/12345" where as on my machine i get the ID only when i do
Code:
myval = $("#myLink").attr("href");
When i move the ID to rel attribute, the browsers behave as intended.
Code:
myval = $("#myLink").attr("rel");
same version of IE on my machine is behaving ok where as on coworkers machine it is not. Am i doing some thing wrong here?
View 6 Replies
View Related
Jul 12, 2011
Does anyone know what i'm doing wrong here. Instead of adding my numbers together its putting them next to each other?
This is the javascript...
Code:
This is the form...
Code:
View 5 Replies
View Related
Jul 19, 2011
Is there any reason why doing...
var chords = document.getElementById('chords');
chords.style.backgroundPosition = (pos+6) + 'px';
Wouldn't work, where... document.getElementById('chords').style.backgroundPosition = (pos+6) + 'px';
Also, after saving it into a variable, asking the console what is in the variable it pulls up... <div id="chords" style="background-position: 1606px 50%; "></div>
Just that, in my mind, saving a set of tags to memory rather than searching for it every 40ms seems to be a better way of going about it. But if I try to do it this way I get given a... "Uncaught TypeError: Cannot read property 'style' of undefined"
View 4 Replies
View Related
Sep 20, 2010
I'm using this to put menus on my website
[URL]
at the top it says its capable of having more than one menu on a page, but it doesnt give the directions.
View 7 Replies
View Related
Jul 9, 2011
I have a button and a textarea. I want this button to add tags around the selected words in that textarea. For example the button is to add the <b> tag before the selected words and the </b> tag after the selected words. Just like these buttons, in the forms of creating a new thread,that are used to make the font of the selected words bold, italic, underlined or colored.
View 5 Replies
View Related
Jul 23, 2005
I implemented some code to perform highlighting and specific anchors are used for the searched words. The problem is when the searched words are inside <a href> tags, the links are lost after putting my anchors.For example:
View 1 Replies
View Related
Apr 29, 2011
So i been doing this color changing and text chaning randomly my text changes randomly but i need the background of the box to change the codes i type in make the entire web site change color but i need the box and this is what im writing
<html>
<head>
<title>HTML and JavaScript</title>
<link href="capstone.css" rel="stylesheet" type="text/css"></link>
<script>
[Code].....
View 5 Replies
View Related
Jul 1, 2011
set up a simple Function that allows me to create a thumbnail image viewer with headings and text.
One of the variables is a Hyperlink.
It all works fine but I want the hyperlink to open as a PopUp Window, but not sure how to do it.
My Code
function LoadGallery(pictureName,imageFile,titleCaption,captionText,titleText,textText,titleJob,jobText,title Pricelist,pricelistText)
{
var picture = document.getElementById(pictureName);
[Code].....
but what I want is when you click on the text "Click here to see Gemma's Service Price List" (specific to Gemma of course).
.... her price list opens in a popup?
(If you want to try this Gemma is the Director with the Burgundy haircolour, top left on the page).
P.S. I am using the <div class> and id to pass the variable data through the function and display the enlarged image and relevant text and hyperlink... if that makes sense ?
View 6 Replies
View Related
Jul 6, 2006
I wish to use J.S. to obtain the screen ht and put this value into a hidden
field for posting. so that I can then use it in a php file.
A simplified script of what I am trying to do is below, but it doesnt work.
I have not used javascript much and I'm sure its straight forward.
<script type="text/javascript" language="javascript">
var ht = document.body.clientHeight;
</script>
<form action="my.php" method="post">
input name="screenht" type="hidden" value="ht"
</form>
View 5 Replies
View Related
Dec 18, 2010
Im just getting started with jQuery and have successfully made a div "slideUp".I was going to put a long div on the top of a page with a message, show for a few seconds, and then slide up to disappear. I've seen that technique used quite a bit lately.Is there a way I can delay the run of my slideup function? I'd rather it be timed or delayed, than click to close.
View 1 Replies
View Related
Mar 29, 2010
I have to send a several arrays as query parameters to a Spring server.
The payload I'm trying to send is this:
[Code]...
Please help. This kind of thing is driving me nuts. I hate working with primitive stuff and having to do a lot of redundancy just to get data transmitted. I just want it to work with the domain object model on the server... but there's always these weird exceptions that make that impossible. It's amazing that in 2010, we are still working in basic numbers and arrays and having to take apart and put together data at a primitive level.
View 15 Replies
View Related
Aug 29, 2009
This may seem like a silly question...
What are the rules for putting a semicolon at the end of a line of code?
View 6 Replies
View Related
Jan 19, 2011
I have not been able to do any JS because my damn books have been on order for the last 3 weeks put a script into my webpage so that when anybody visits the 'contact us' page they can leave comments.
Here's my code:
HTML:
<!DOCTYPE html "PUBLIC-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[Code].....
I know this doesn't validate but it's only a draft site until I get my books.
Here's the page, I want the comment underneath all three div's.
View 1 Replies
View Related
Mar 8, 2011
import java.util.Random;
import java.util.Scanner;
public class HighLowGame
{
public static void main(String[] args)
{
[Code]....
Two questions, why doesn't my program let me keep putting in numbers until I guess the right one? What is wrong with my loop? Pressing 1 should repeat the program, any other number should close.
View 2 Replies
View Related
Nov 9, 2011
It seems like it should be simple, but I don't see what I'm missing. Right now, the search button displays directly under my input field. I've gone through the CSS, but can't figure out where my code is forcing the button onto its own line. What am I missing? How can I bring it up to the same line?
<form role="search" method="get" id="searchform" action="http://www.centerpie.com/" >
<div>
<input type="text" value="" maxlength="100" name="s" id="s"><input type="submit" id="searchsubmit" value="Search">
</div>
</form>
View 4 Replies
View Related
Aug 17, 2006
Is there a way to make a background color rollover without putting it all down by the tag?
My unworking code:
<script>
<script>
document.getElementById("menulink").
document.getElementById("menulink").
</script>
<p>Menu</p>
<div id='menulink'><a href='index.php'>Home</a></div>
<div id='menulink'><a href="#">Link</a></div>
I havent worked with javascript in awhile...
View 6 Replies
View Related
Dec 1, 2011
Right now, I am busy preparing a website on which I want to 'exhibit' some of the paintings I've done in the last few years. Okay, it's only amateur stuff, I think it would be nice to be able to show some of my work to the world. My site will consist of a set of simple frameset pages; in the largest of these frames, I plan to put scans of the actual works, in other frames there will be a title, a menu, some additional texts and so on. Obviously, I want to present my images optimally. But of course, it's quite impossible to predict what size my 'painting frame' will be.
That is why I would <i>love</i> to have a piece of Javascript code
1) That will put my images exactly in the middle of the painting frame (aligned both vertically and horizontally),
2) That will use as much of the available space as possible, and
3) That will keep the aspect ratio of each image intact.
I've tried the nice 'Full Size Image' script that Eddie Traversa once made, but unfortunately, his script just fills up the entire frame space, distorting either the height or the width of the image concerned. You'll onderstand why this is not what I need here. In case you are interested: some of the paintings I did can be seen in a book I am also working on, PANTACYCLOPEDIA [URL] - I've used some of them as illustrations there.
View 2 Replies
View Related
Mar 29, 2011
I was developing a site search for someone and I got it fully functioning-- the php calls on the input field with #searchField.All the user has to do is begin typing and the results appear underneath without ever having to click submit or enter/return.However, the customer was wondering if I could integrate the Wolfram Alpha Computational Search as well.So that a page visitor or user would type in the search field the results searching his site would appear below, as mentioned above; but, if one typed a query and hit enter then it would search WolframAlpha.I first made a page, here, that uses the code Wolfram Alpha's developer community was giving to developers that creates an input field and searches wolfram Alpha one hits enter. (It writes the necessary html in a messy way and includes this base.css file)Here is a screenshot of the html code that the wolframAlpha.js file writes from chrome dev tools.
After doing so, I put the code of the page I developed for my client and the above page together and what I got was two separate input fields, one that searches the site (top, but it doesn't work due because I did not attach that file as where this is located can't parse PHP) and one that searches wolfram alpha (bottom -- does work).You can see the result of the combined code here.
View 2 Replies
View Related
Oct 13, 2006
How do I do something, where
var x="-20%";
document.all("something").style.top=x
normally, this would work --
document.all("something").style.top='-20%'
but the above formulation doesn't..... is there some diff way?
View 2 Replies
View Related
Mar 18, 2010
I have an ASP.NET web-app that consists of a master page and several .aspx pages that use that master page.
1. problem: If I include the jQuery library in the master page at the bottom right before </body> (and after the content placeholder), then in my .aspx pages I am unable to use jQuery because it is included "below" all JS code defined in the pages.
[Code]...
View 2 Replies
View Related