181
Web Programming and Design / Webdeveloping Questions
« on: April 03, 2012, 08:14:04 am »
Ok, I decided to launch a thread with webdeveloping questions as I have so many questions....I just like programming stuff for my website
Well, first of all, is it possible to open a link in a new tab with Javascript?
Second...Well, I want to store pics in an array (Javascript), the pics are the canvas pics, it is generated dynamic by php, and want that the nexxt pic won't start loading before the one before was finished.
I wrote this:
[14:06:08.411] uncaught exception: [Exception... "The type of an object is incompatible with the expected type of the parameter associated to the object" code: "17" nsresult: "0x80530011 (NS_ERROR_DOM_TYPE_MISMATCH_ERR)" location: "[no need to know]"]
Please help me!
Well, first of all, is it possible to open a link in a new tab with Javascript?
Second...Well, I want to store pics in an array (Javascript), the pics are the canvas pics, it is generated dynamic by php, and want that the nexxt pic won't start loading before the one before was finished.
I wrote this:
Code: [Select]
<?php
if ($handle = opendir($folder))
{
echo "pics = new Array();";
$pics = array();
while (false !== ($entry = readdir($handle)))
{
if (preg_match("/[^\.].*\.(jpg|jpeg|png|gif)$/i", $entry))
{
array_push($pics,$entry);
}
}
closedir($handle);
sort($pics);
$j = 0;
foreach ($pics as &$pic)
{
echo "function pic$j () {
pics[$j] = new Image();
pics[$j].src = '$folder/$pic';
pics[$j].";$j++;echo"addEventListener('load',pic".$j.",false);
}\n";
}
echo "function pic".$j." () {};\n\n\n";
}
?>
Well, the errorkonsole of firefox gives me this:[14:06:08.411] uncaught exception: [Exception... "The type of an object is incompatible with the expected type of the parameter associated to the object" code: "17" nsresult: "0x80530011 (NS_ERROR_DOM_TYPE_MISMATCH_ERR)" location: "[no need to know]"]
Please help me!