JavaScript - Let's Say I Wanted To...
Take a variable...
var time = "12:00" split it... var hour=time.split(":"); ...then add or subtract from the numeric value of hour[0] based on timezone. ie. EST = -5 PST = -8 What would be the best way of doing this? Similar TutorialsHello I have a question for you guys and I hope someone could help me: I am trying to build a site , classified ads. And one of the features is selecting/making ads that you want to see in a separate page later on(something like a shopping cart) BUY way simpler after a user search for something he gets a LIST of numbered ads(different ID for each) and a button SELECT/MARK this ad. This select/mark button suppose to add the specific ad ID to a coockie and then when the user clicks "go to see my ads" its will pass ALL the ID numbers to aPHP page that will print what it should. what I was trying to do is try to use a "shopping cart" script and just use the part that each product has a "add to cart" button and in the "my cart" page it will show the selected products, but as I have no clue about javascript in this way I was willing to pass the variables(ID numbers) with JS and $_GET them with PHP and from there I can continue so what I need is : Asimple <form> that when u submit it , it sends a variable(ID) to a coockie and STAYS ON THE SAME PAGE then when you decide to see the selected list it will pass all the ID variables to the page with the link it self and I can GET it with PHP Any help Hi all, I want to find a Javascript if possible that emmulates the fuctionality shown under Editor's choice on either of these sites. http://www.irishtimes.com www.cnn.com I won't be using video but I would like the user to be able to click on a Left or Right arrow and upon doing this a new batch of Images with associated URL links will slide in. Problem I have is that I do not know what I should search for. Have tried keywords such as "Image Link Scroller", "Slideshow" but have not found a script that does something like what is on these websites. Any ideas? How can i go about showing on screen a count from an initial value to an end value over a set time period. Initial value = 0 End value = 2000 Time = 25 seconds I cant find an example of this anywhere, so I'm trying here to see if somebody can help Hi there, I have a search function on my website. When a user types something, options (including his characters) are displayed in a box (layer) as hyperlinks using Ajax, a very common feature these days. My problem is that if the user clicks somewhere else in page the links display stays on screen. I tried to fix the issue by adding an onBlur event to the search box (different id that the "display" div): Code: document.getElementById('livesearch').style.display = 'none'; where livesearch is the id of the hyperlinks displaying div. Job done but...the hyperlink "box" dissapear and the problem now is that the links are not working (if you click on one, the div dissapear first (I SUPPOSE) and no redirection to link is made....) I tried a couple of if else tricks I could think of with no success. No need to say that I am not a javascript wizz....hope you like the js1 username Any help will be appreciated. Thank you in advance, Julian Hi, I am trying to write a small web app that is used to do some plots for over-the-time-collected data (children's growth measurements). The current objective is to re-use entered data. As I do not want to store anything on the server (which would lead to all the annoying username-password-stuff), nor in cookies, I would like put measurements into a local file and reload them into the HTML entering form. I know and fully appreciate that javascript is not able to read or write files; it is on the other hand obvious that this can be bypassed if I upload the respective file to the server which returns it in an ajax fashion. My main question is now: Is it possible to do some kind of internal upload, that ends up in a read of a local file? Something like a <form method="post" action="localscriptname" ...> with an <input type="file"...> field? Another (off-topic) question: My plots are in PDF format. I accidentally appended some data to the PDF file which did not cause any problems for the pdf readers. Can I rely on the fact that any pdf reader will ignore data after the %%EOF mark, but will keep it if a file is downloaded, directly opened by acroread or whatever, and later saved from the reader program? This would allow it to keep the plot and the raw data in one file and might be helpful for the not-so-computer-affine target audience of my program. Greetings! Hi, It would be easier to explain this if you play mafia wars (or any game that includes intra-game exchange of gifts/items between members) but the actual scripting doesn't require any knowledge of the game. Background Information Mafia Wars is a game on Facebook (and myspace, yahoo etc.) that among other things allows its players to send gifts to each other. Now because different people end up with more things of one type and are short of things of another type, the players have evolved a trading dynamic. Where x number of Item 1 is traded for y number of Item 2. A simple marketplace. And with this territory come scammers. Essentially a player who doesn't go through with his end of the deal. good player sends item to bad player. bad player removes good player from mafia and blocks him for ever contacting him through his facebook profile. This has given rise to my group, among many others, that lists these scammers (identified with their facebook profile ids) as they are reported every day. Now over time the list has grown and it has become difficult and unrealistic to expect people to know who is on the list and who is not. The Requirement A javascript bookmarklet (there are many already servicing different needs of the players) that sits on the browser and tells the user if the person he is about to trade with is a listed scammer or not. The Breakdown The user will click the bookmarklet when he is on the facebook profile of the person he is about to trade with. When clicked the script will pull the facebook profile id from the current page, and then scan a text file located on a third-party server and return with a pop-up box message that reports if the id is listed as a scammer or not. It should be pretty simple to do, except I don't know the first thing about javascript coding. So if there's anyone who can devote a few hours/days to help us out with this it would be greatly appreciated. Thank you. Hi, It would be easier to explain this if you play mafia wars (or any game that includes intra-game exchange of gifts/items between members) but the actual scripting doesn't require any knowledge of the game. Background Information Mafia Wars is a game on Facebook (and myspace, yahoo etc.) that among other things allows its players to send gifts to each other. Now because different people end up with more things of one type and are short of things of another type, the players have evolved a trading dynamic. Where x number of Item 1 is traded for y number of Item 2. A simple marketplace. And with this territory come scammers. Essentially a player who doesn't go through with his end of the deal. good player sends item to bad player. bad player removes good player from mafia and blocks him for ever contacting him through his facebook profile. This has given rise to my group, among many others, that lists these scammers (identified with their facebook profile ids) as they are reported every day. Now over time the list has grown and it has become difficult and unrealistic to expect people to know who is on the list and who is not. The Requirement A javascript bookmarklet (there are many already servicing different needs of the players) that sits on the browser and tells the user if the person he is about to trade with is a listed scammer or not. The Breakdown The user will click the bookmarklet when he is on the facebook profile of the person he is about to trade with. When clicked the script will pull the facebook profile id from the current page, and then scan a text file located on a third-party server and return with a pop-up box message that reports if the id is listed as a scammer or not. It should be pretty simple to do, except I don't know the first thing about javascript coding. So if there's anyone who can devote a few hours/days to help us out with this it would be greatly appreciated. Thank you |