Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   TypeError: $(...).printMe is not a function (https://javascript.ru/forum/misc/57649-typeerror-%24-printme-not-function.html)

Lecseus 13.08.2015 08:52

TypeError: $(...).printMe is not a function
 
Здравствуйте.
Пытаюсь реализовать возможность печатать что-либо в PDF при помощи плагина js printMe. И мне в консоли все-время выпечатывается такая ошибка.
вот мой код, простите, если длинный:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>
	
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

	<style type="text/css">
		#btn1{
			margin-left:380px;
		}
	</style>
	
	</head>
	<body>
	<br/>
		<div class="container">
			<div id="table1">
			<h3>Striped Table</h3>
					<table class="table table-striped">
					  <caption>Optional table caption.</caption>
					  <thead>
						<tr>
						  <th>#</th>
						  <th>First Name</th>
						  <th>Last Name</th>
						  <th>Username</th>
						</tr>
					  </thead>
					  <tbody>
						<tr>
						  <th scope="row">1</th>
						  <td>Mark</td>
						  <td>Otto</td>
						  <td>@mdo</td>
						</tr>
						<tr>
						  <th scope="row">2</th>
						  <td>Jacob</td>
						  <td>Thornton</td>
						  <td>@fat</td>
						</tr>
						<tr>
						  <th scope="row">3</th>
						  <td>Larry</td>
						  <td>the Bird</td>
						  <td>@twitter</td>
						</tr>
					  </tbody>
					</table>
			</div>
		</div>	 
			<p>
			<button class="btn btn-primary" id="btn1" type="submit">Print</button>
			</p>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
	<script src="E:/Andevis/Решения/Решения для моего SharePoint портала/PrintJQuery/printMe/jquery-printme.js"></script>
    <script >
	$("#btn1").click(function(){
		$("#table1").printMe();
	});
	</script>  

  </body>
</html>


что я делаю не так, подскажите, пожалуйста?

ksa 13.08.2015 09:43

Цитата:

Сообщение от Lecseus
Пытаюсь реализовать возможность печатать что-либо в PDF при помощи плагина js printMe.

И что про него можно прочитать?

Lecseus 13.08.2015 10:06

Да уж и читал про него. Уже и по-разному перепробовал файл размещать, все равно пишет, что это не функция. Запарился уже..

рони 13.08.2015 10:08

Lecseus,
положите jquery-printme.js в папку с документом и в пути укажите только имя src="jquery-printme.js">

рони 13.08.2015 10:09

Lecseus,
и ещё вариант строку 62 перенесите в строку 69

ksa 13.08.2015 10:19

Цитата:

Сообщение от Lecseus
Да уж и читал про него.

Я не читал. :D Хочу почитать...

Lecseus 13.08.2015 10:45

спасибо, рони. попробывал переместить строку, не вышло результата. использовал ваш совет положить файл в папку с документом, но прежде вновь скачал архив с плагином и распаковал, указал просто имя src="...js" и все заработало. благодарю.

Lecseus 13.08.2015 10:46

:) https://github.com/menusal/printMe

ksa 13.08.2015 10:47

Lecseus, т.е. ссылок на js printMe я не дождусь? :cray:


Часовой пояс GMT +3, время: 19:40.