-
Posts
7,761 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by jeffman
-
-
Google sticky footer. Several CSS techniques need to be combined to make this work. Since the problem has been solved, there's no need to repeat the solution(s) here.
-
I posted a reply to your first post right after you posted your second post. My answer no longer made sense. So "Never Mind."whats nm stand for diedres dad. -
-
Oops. Just noticed something. This might be new since I last put JS in a link. The whole window.open command ended up in my address bar. The content of my original window was obliterated and replaced with the return value of window.open. Changing the code to this fixed that: 'javascript:var x=window.open( etc. . . . But the best solution is probably not to use an <a> element at all. Use a <p> or a <span> and add an onclick handler.
-
For city and address, there may be nothing you can do. Even in one country, there are many different ways to write an address. Your best bet is to make sure there is no HTML in the text, no javascript, and if you are saving this in a database, always prevent SQL injection. You can Google that.
-
I'm using Firefox, and that code opens a window correctly. Please explain what happens in your browser and what you mean by "not working." Does a window open? Is the location wrong?
-
localStorage.myKey is just normal object syntax for JavaScript. It was the standard before we had methods like setItem and setAttribute. In Firefox, at least, it also works if you write localStorage['myKey'], whch is also normal object/array syntax. ("myDiary_" + TodaysDate) should work. To see if there is already data there, try something like this:
var data = localStorage.getItem("myDiary_" + TodaysDate);
If that key hasn't been defined, the getItem method should return "undefined" (Firefox does this) or something else that evaluates to false. It should not throw an error.
-
PHP releases
in PHP
For what it's worth, creating your own objects in PHP is fairly simple and not required. It's not like some languages where every line of code must be embedded in an object. As to PHP's library objects, I find them conveniently organized and usually well explained. If an object has multiple levels of inheritance, you may have to look at several pages of the manual to find all the information you need.New php with oops concepts available in the market and which is a little bit tough in programming for website. -
If it helps, both of these create the same result
localStorage.setItem('myKey', 'myData');localStorage.myKey = 'myData';
In each case, you can think of "myKey" as the key that points to the string "myData." I'm not sure what you mean by "a multi-part KEY." That's what I thought I was showing you when I mentioned JSON, but perhaps it's not.
-
Gosh, that never occurred to me.
-
You don't need an alternate. You do need to post your code so we can see what's wrong. OTOH, there might be a tool in jQuery that will do what you want in a more user-friendly way. So maybe you could explain what your goal is, too.
-
I don't know why you are interested in files. As far as I know, the W3C doesn't have a specification for implementing localStorage. Every browser will do it differently, and a single browser might do it differently on different platforms. Expecting certain filenames to be created seems like a waste of time. Maybe you should explain your goals more clearly. It's possible that what you want cannot really be done, or can be done using other tools, but I am not certain.
-
This interested me so I played around. Local storage will only accept a string as data. So you need to be able to create a string of key-val pairs that you can parse. JSON is the perfect solution. Here's some code that shows a basic implementation.
<!DOCTYPE html><html> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <title></title> <script type="text/javascript"> function init () { document.getElementById("button1").onclick = function () { var obj = new Object; obj.key = "val"; localStorage.test = JSON.stringify(obj); } document.getElementById("button2").onclick = function () { var newObj = JSON.parse(localStorage.test); alert(newObj.key); } } window.onload = init; </script> </head> <body> <div> <input type="button" value="Set" id="button1"> <input type="button" value="Alert" id="button2"> </div> </body></html>
-
You can use the PHP file function to grab a file anywhere on the internet. That will give you an array of CSV data for each company. That should be pretty easy to work with.
-
What you really want is for the document to have an element, like a div or something, and update its innerHTML property every time the loop iterates. The div should have an id so you can get a reference to it using document.getElementById().
-
For starters, don't put the numbers in quotation marks.
-
A form is a block-level element. By default it will always float below the previous element. Try putting the image inside the form. You'll have new alignment issues when you do that, but at least they can be solved.
-
In strongly typed languages, you declare variables at the top of functions so that the compiler can allocate memory. PHP is weakly typed and allocates memory dynamically, so this type of declaration is not required. As others have pointed out, there may be practical reasons for naming/defining a variable before it is used, but this is not the same as a requirement.
-
I don't do flash, but I do a lot of AJAX. The process looks similar. If I'm right, your PHP script should NOT contain any HTML tags. There should only be the script, so that it only echoes what you need. With the HTML tags and spaces and newlines, all that is getting sent also.
-
An alternative is to put the data in a table. The would give you neat rows and columns to work with. The cell borders are optional and can be styled.
-
Everything you need to know about changing the style is here. Check the syntax example at the top, then scroll down to see the text properties.
-
Well, I can. I sort of hate to, but I tested this and it "works." I suggest doing a View Source before and after you click the text to execute the function.
<!DOCTYPE html><html> <head> <script type="text/javascript"> function writeMe() { var s = "<pre>hi"; s += "\n"; s += "John"; s += "\t\t"; s += "Smith </pre>"; document.write (s); document.close(); } </script> </head> <body> <p onclick="writeMe()">Click me</p> </body></html>
-
You say you have some web skills, but not AJAX. If you want to do serious work on the web, learn that. And since using AJAX implies DOM manipulation, expand that skillset also. Users expect to be able to push a button and watch half the document change without a page refresh.
- 1
-
I hesittate to support the use of document.write -- but I'll assume your reasons make sense. 1. Try putting your text inside <pre></pre> tags. that should preserve the formatting. 2. Use \t and \n (in quotes) for tabs and newlines.
Would like a tutorials on the lower section of this php code.
in PHP
Posted