![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
nogray
-
Posts
930 -
Joined
-
Last visited
Posts posted by nogray
-
-
You'll lose the function scope in setTimeout, you can use global variables or the variable value.
e.g.
setTimeout("okaythen('" + trID + "')",2000);
Notice the single quote ' before the " + to make the value as a string
-
div1.className = "class1"; works in any grade A browser
-
if mySecondVar is a string, use document.getElementById(mySecondVar).src = "...";
-
Yep,
alert(parseInt("08")); // alerts 0
alert(parseInt("08", 10)); // alerts 8
-
You can just assign a different id after you clone the object
p = document.getElementById("para1"); p_prime = p.cloneNode(true); p_prime.id = "my_new_id";
-
remove the <?php and ?> from the string and use eval function
eval('some php code here');
-
Some ajax may help. Simply when the page load attach an event to all the links and make them fetch the page content using AJAX. If the JS breaks, the link still points to the page, you can also add a special query to the URL as an ajax (i.e. var url = a.href + "?ajax=1"
-
make sure you call teh JS after the page has loaded (onload event)
-
If you open a page with JS locally (on your computer, not online), it'll always show the yellow bar
-
You can modify the previous script to output a javascript array from php and use that array to loop through the elements
function toggle_alpha(target) { var divs = ['A','B','C','Color','D','F','K','L','P','Q','R','S','Z']; // use php to output this array for (i=0; i<divs.length; i++) document.getElementById('Searchstring_'+divs[i]).style.display = "none"; document.getElementById(target).style.display = "inline"; }
You can detch the document.all since IE support document.getElementById()
Also, you can make a JS object that will update the HTML of the div based on the user click
<script type="text/javascript"> var cont = {}; cont.A = 'this is a'; // use PHP to output these lines cont.B = 'this is b'; cont.Color = 'this is color'; function update_div(val){ document.getElementById('div_id').innerHTML = cont[val]; } </script> <div id="div_id"></div>
Not tested
-
"CC: My Name<me@myemail.com>" in the mail headers
-
-
Try to search this form on how to validate numbers (or search google) most likely you'll find a regular expression (something like value.match(/^\d+$/))
Try to browse your site using firefox and after you get the error, click on "Tools" (next to File, Edit, View) and select "Error Console" This will help you find the bugs you have.
I always use document.getElementById() for anything, for the select menu, try to get the option value
document.AddProduct.ItemType.options[document.AddProduct.ItemType.selectedIndex].value
and see if that's work.
-
You only can access form fields by document.form.field, other elements you'll need to use document.getElementById('ID')
In your code, you'll need to change
document.mySpan5.innerHTML (or 1, 2,3,4,etc...)
to
document.getElementById('mySpan5').innerrHTML
Hope this helps.
-
you can try to add it the event from a script
<script type="text/javascript"> document.getElementById('about').onmouseover = function(){ document.getElementById('description').innerHTML = "whatever"; }; </script>
-
Something like this
function toggle_alpha(target) { var alphabits = "ABCDEF....Z"; // just fillin the blanks for (i=0; i<alphabits.length; i++) document.getElementById('Searchstring_'+alphabits.charAt(i)).style.display = "none"; document.getElementById(target).style.display = "inline"; }
Not Tested
-
okay, I just tested with document.onclick and it looks like it's working. Here is an example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script language="javascript"> document.onclick = function(){ alert('here'); } </script> </head> <body> <div>Hello</div> </body> </html>
-
Commericial script: http://www.clip-share.com/
Server side video format conversion: http://ffmpeg.mplayerhq.hu/
Online tools for users:
http://www.mediaconverter.org/index.php
Software for users:
http://www.download.com/Ultra-Video-To-Flash-Converter/3000-2194_4-10534134.html?tag=lst-0-8
JavaScript/ActiveX can't convert video when uploading, you'll need to convert it before or after.
-
make sure your select options have values
<option value="Video">Video</option>
-
Your second request override your first request. Your req variable must be a local variable in the function, try to add a var infront of it
if (window.XMLHttpRequest) { var req = new XMLHttpRequest(); } else if (window.ActiveXObject) { var req = new ActiveXObject("Microsoft.XMLHTTP"); }
hope that's work.
-
first make sure you have an id in the input field and it's uniq ( id="username" ), if it's still not working, you can post your code or URL and I can take a quick look
-
try document.body.onclick
-
For accessibility point of view, bronzemonkey is correct. Personally, if the user's browser doesn't support JS, they should either update their browser or enable JS to browse my site (if I am losing 5% because of JS is not enabled, oh well). Using a simple CSS style to make the tr looks clickable "such as cursor:pointer" will solve any display questions for the user. But the final discussion is for the website owner and how does s/he wants the user to interact with their site.
-
it's because you're using curly quote marks in the script tag <script language=”javascript”>
You should use normal quote marks "
If you copied an example for MS Word or a website, make sure all the quote marks are " and not ”
Javascript Redirect...
in Javascript Help
Posted
put this in the head section (or anywhere you want)