Jump to content

PHP jQuery Problem


lewisstevens1

Recommended Posts

Hey i was just wondering why i keep getting a problem with Uncaught TypeError: Object [object Object] has no method 'editable'.
 
It only came up after i sorted Uncaught TypeError: Object [object Object] has no method 'jWindowCrop'. It was due to the placement of the scripts before - although im not sure if thats the problem as they look neat now and jquery is before all.
 
Also i was wondering about onsubmit="return checkCoords();" as that was also appearing that checkCoords() does not exist yet it used to work. I was using the jWindowCrop v1.0.0 script.
 
Thanks
Lewis
 
index.php
<!DOCTYPE html>
<head>
<meta name="description" content="">
<meta name="keywords" content="">
<meta charset="windows-1252">
 
<!-- Javascript -->
<script type="text/javascript" src="content/javascript/jquery.js"></script>
<script type="text/javascript" src="content/javascript/general.js"></script>
<script type="text/javascript" src="content/javascript/hover_script.js"></script>
<script type="text/javascript" src="content/javascript/jquery_corner.js"></script>
<script type="text/javascript" src="content/javascript/default_text.js"></script>
 
<!-- Stylesheets -->
<link type="text/css" rel="stylesheet" href="content/stylesheets/general.css" media="screen">
 
<!-- Javascript -->
<script type="text/javascript" src="plus_cms/javascript/jeditable.js"></script>
<script type="text/javascript" src="plus_cms/javascript/jWindowCrop.js"></script>
<script type="text/javascript" src="plus_cms/javascript/charcounter_main.js"></script>
<script type="text/javascript" src="plus_cms/javascript/charcounter_custom.js"></script> 
<script type="text/javascript" src="plus_cms/javascript/bar.js"></script> <!-- Need Last -->
 
<!-- Stylesheets -->
<link type="text/css" rel="stylesheet" href="plus_cms/stylesheets/bar.css" media="screen">
 
<title>Product Profile</title>
</head>
<body>
<!-- Page Head -->
<div id="push_page"></div>
 
<div id="plus_bar_wrapper">
<div id="plus_bar">
<a href="#" class="left"><img src="plus_cms/images/account_default.png" alt="Account"></a>
<h1>Admin</h1>
<a href="#" class="right"><img src="plus_cms/images/plus_default.png" alt="Plus"></a>
</div>
</div>
<div id="page_header">
<div class="top">
<div class="page_width_center">
<a href="#">Contact Us</a>
<a href="#">About Us</a>
<a href="#">Home</a>
</div>
</div>
<div class="bottom">
<div class="page_width_center">
<a href="http://www.oliverandbird.co.uk/index2.php"><img src="content/images/logo.jpg" alt="Logo"></a>
 
<form action="product_search.php" method="GET">
<div id="search_bar">
<input type="text" name="search_wine" id="search_wine">
<input type="submit">
</div>
</form>
<a id="shopping_wrapper">
<p>Cart (0 Bottles) ?</p>
 
<span style="font-family:arial,sans-serif; font-size:11px; color:#FF0000; float:left; margin-top:-10px; width:200px"> </span>
</a>
</div>
</div>
</div>
<div id="page_subnavigation">
<div class="page_width_center">
<div>
<div class="left">
<ul><a href="product_selection.php?country=1&type=all&sort=product_name&dir=asc"><li class="active" style="text-transform:capitalize;">france</li></a><a href="product_selection.php?country=2&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">italy</li></a><a href="product_selection.php?country=3&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">spain</li></a><a href="product_selection.php?country=4&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">portugal</li></a><a href="product_selection.php?country=5&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">austria</li></a><a href="product_selection.php?country=6&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">argentina</li></a><a href="product_selection.php?country=7&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">south africa</li></a><a href="product_selection.php?country=8&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">astralia</li></a><a href="product_selection.php?country=9&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">chile</li></a><a href="product_selection.php?country=10&type=all&sort=product_name&dir=asc"><li style="text-transform:capitalize;">new zealand</li></a><li class="cancel1"><img src="plus_cms/images/cancel.png" alt="Cancel" style="margin-top:-2px" class="cancel_button" title="Remove Category"></li>
</ul>
</div>
 
<div class="right">
<h1>Need Advice?</h1><h2><div class="edit_area1_2" id="6">019841241241</div></h2>
</div>
</div>
</div>
</div>
<div id="page_subnavigation2">
<div class="page_width_center">
<div>
<div class="left"><ul>
<a href="product_selection.php?country=1&type=all&sort=product_name&dir=asc">
<li class="active">All</li></a><a href="product_selection.php?country=1&type=11&sort=product_name&dir=asc"><li style="text-transform:capitalize;">red</li></a><a href="product_selection.php?country=1&type=12&sort=product_name&dir=asc"><li style="text-transform:capitalize;">white</li></a><a href="product_selection.php?country=1&type=13&sort=product_name&dir=asc"><li style="text-transform:capitalize;">rosé</li></a><a href="product_selection.php?country=1&type=14&sort=product_name&dir=asc"><li style="text-transform:capitalize;">sparkling</li></a><a href="product_selection.php?country=1&type=15&sort=product_name&dir=asc"><li style="text-transform:capitalize;">port</li></a><a href="product_selection.php?country=1&type=16&sort=product_name&dir=asc"><li style="text-transform:capitalize;">other</li></a><li class="cancel1"><img src="plus_cms/images/cancel.png" alt="Cancel" style="margin-top:-2px" class="cancel_button" title="Remove Subcategory"></li>
</ul>
 
</div> 
<div class="right">
<h1 class="edit_area1_1" id="5">Build your custom crates. 12 bottles per crate.</h1>
</div>
</div>
</div>
</div><!-- Page Body -->
<div id="page_body">
<div class="page_width_center"> 
<div id="side_navigation2">
<div><a href="product_selection.php?country=1&type=11&sort=product_name&dir=asc">Return to Wine List</a></div>
 
<div class="advertising_wrapper"></div>
</div>
 
<div id="right_side_page">
 
<div id="title_banner">
<p class="product1" id="5-product_name">marselan</p>
</div>
<div class="left">
<a id="profile_1" class="image_change"><img src="content/images/product_uploads/large/default.jpg" width="410px" style="margin-left:0px;" alt="Product"></a>
</div>
<div class="right">
 
<table cellspacing="0" cellpadding="8px" style="margin-top:5px; width:100%">
<tbody><tr><th>Availability</th>
<td style="padding:0px; margin:0px">
<img src="content/images/layout/cross.png" style="float:left; padding:0px; margin:0px; margin-top:10px; " alt="Cross">
<p style="float:left; margin:0px; padding:0px;"></p><div class="product3" style="height:16px; margin-top:6px; padding-top:10px; padding-left:30px;" id="5-stock_level">Out Of Stock</div><p></p></td>
</tr>
<tr>
<th>Product ID</th>
<td>5</td>
</tr>
<tr>
<th>Domaine</th>
<td style="text-transform:capitalize;" class="product1" id="5-domaine">Domaine Lalaurie</td>
</tr>
<tr>
<th>Principal Grape(s)</th>
<td style="text-transform:capitalize;" class="product1" id="5-dominant_grapes">Marselan</td>
</tr>
<tr>
<th>Origin</th>
<td style="text-transform:capitalize;" class="product1" id="5-origin">I.G.P Pays d'Oc</td>
</tr>
<tr>
<th>Colour</th>
<td style="text-transform:capitalize;" class="product4" id="5-colour">red</td>
</tr>
<tr>
<th>Vintage</th>
<td class="product1" id="5-vintage_year">2009</td>
</tr>
<tr>
<th style="color:#9E0739; border-bottom:0px;">
<p style="margin-top:0px;">Price</p>
</th>
<td style="color:#9E0739; border-bottom:0px; font-size:16px;">
<p style="float:left; margin:2px;">£</p>
<div style="float:left; margin:2px;" class="product5" id="5-bottle_price">12</div>
<p style="float:left; margin-top:2px; margin-left:0px; margin-right:0px;">.</p>
<div style="float:left; margin-top:2px;" class="product6" id="5-bottle_price2">12</div>
</td>
</tr>
</tbody></table>
 
<div class="product_text"><div class="product2" id="5-product_description">weeeeeeeeeeeeeeeeeeeeeeeee</div></div></div> 
</div>
</div>
</div>
 
<div class="popup_bg1"></div>
<div class="popup1">
<div class="status_bar"><p>Image Upload</p><a class="popup_close"></a></div>
<div class="popup_content_wrapper">
<div>
<iframe src="plus_cms/image_upload.php" style="width:100%; float:left; height:105px; margin-top:-10px; border:0px; border-bottom:1px solid #CCC; margin-bottom:20px;"><p>Your Browser Is Out-Of-Date.</p></iframe>
 
<iframe src="plus_cms/image_crop.php" style="width:100%; float:left; height:600px;"><p>Your Browser Is Out-Of-Date.</p></iframe> 
 
 
</div> 
</div>
</div>
<!-- Page Footer -->
<div id="page_footer">
<div class="top">
<div class="page_width_center">
 
 
</div>
</div>
<div class="bottom">
<div class="page_width_center">
<p>Copyright © <a href="plus_cms/login.php">oliverandbird.co.uk</a> - All Rights Reserved. Website Designed By <a href="http://www.tomlewismedia.co.uk" target="_BLANK">Tom Lewis Media</a>. </p>
</div>
</div>
</div>
</body>
</html>
 
Image Upload:

<!DOCTYPE html>
<head>
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
 
<!-- Javascript -->
<script type="text/javascript" src="javascript/jquery.js"></script>
<script type="text/javascript" src="javascript/bar.js"></script>
 
<!-- Stylesheets -->
<link type="text/css" rel="stylesheet" href="stylesheets/bar.css" media="screen"/>
</head>
 
<body>
<div class="upload_image"><p>Upload Image</p>
<form action="image_upload.php" method="POST">
<input type="file" name="photo" style="width:600px; float:left; cursor:pointer;"/>
<div id="submit_wrapper">
<input type="button" id="upload_button" name="upload_button" value="Upload Image"/>
</div>
</form>
</div>
</body>
 
Image Crop:

<?php
$visited2 = $_COOKIE["image_upload"];
 
$src1 = '../content/images/product_uploads/large/';
$src2 = '../content/images/product_uploads/temp/';
 
$first_image = $src1."default.jpg";
$second_image = $src2."default.jpg";
 
  if (isset($_POST['image2'])) {
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Location:image_crop.php"); 
 
$targ_w = 300;
$targ_h = 500;
 
$im = @imagecreatetruecolor($targ_w, $targ_h) or die('Cannot Initialize new GD image stream');
$output_file = $second_image;
$img_r = imagecreatefromjpeg($first_image);
$image = imagecopyresampled($im,$img_r,0,0,$_POST['x'],$_POST['y'], $targ_w,$targ_h,$_POST['w'],$_POST['h']);
imagejpeg($im, $output_file);  
}
?>
<!DOCTYPE html>
<head>
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<script type="text/javascript" src="javascript/jquery.js"></script>
<script type="text/javascript" src="javascript/jWindowCrop.js"></script>
<link type="text/css" rel="stylesheet" href="stylesheets/jWindowCrop.css" media="screen"/>
</head>
 
<body>
<table>
<tr>
<td>
<img class="crop_me2" alt="Crop Image" src="<?php echo $first_image.'?'.date('YmdHis'); ?>" />
<?php
echo '
<form action="'.$_SERVER["PHP_SELF"].'" method="post" onsubmit="return checkCoords();">
<input type="hidden" class="x" name="x"/>
<input type="hidden" class="y" name="y"/>
<input type="hidden" class="w" name="w"/>
<input type="hidden" class="h" name="h"/>
'; 
?>
</td>
<td>
<img src="<?php echo $second_image.'?'.date('YmdHis'); ?>" style="border:2px solid #D6D6D6;" />
</td>
</tr>
<tr>
<td>
<input type="submit" name="image2" value="Crop Image" />
</form>
</td>
<td>
<form action="image_crop.php"><input type="submit" value="Refresh Content"/></form>
</td>
</tr> 
</body>

 

Link to comment
https://forums.phpfreaks.com/topic/279854-php-jquery-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.