I am using this procedure that reads my local reference bibtex file and automatically formats them inside my HTML page. The procedure is fairly straightforward but something somewhere is not working and after a LOT of debugging I cannot figure it out.
After spending quite some time on this, I have zeroed down the problem to this area in my code:
...
...
<textarea hidden name="bibtex_input" id="bibtex_input" cols=50 rows=20>
<?php echo file_get_contents("ref.bib"); ?>
</textarea>
<div id="bibtex_errors"></div>
<div class="bibtex_template">
<li>
<a class="url"><span class="title"></span></a><br>
<span class="author"></span><br>
<span class="booktitle"></span>
<span class="if publisher">
<span class="publisher"></span>.
</span>
<span class="if pages">
p. <span class="pages"></span>.
</span>
<span class="if year">
<span class="year"></span></span>
<br>
<a class="bibtexCodeLink">
[bibtex]
</a>
<br><br>
</li>
</div>
<ol id="bibtex_display">
</ol>
</td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
</table>
</body>
</html>
Seems like PHP cannot execute inside the textarea
tags for some reason. Outside the textarea
tags PHP echoes the contents of the file just fine and I can see it on the page. In any case when php is used inside the textarea tags, I cannot see the formatted output on my HTML page and instead see this.
This is what it should look like.
What I have tried:
PHP is working. phpinfo() shows me the PHP version when PHP is invoked anywhere else on the page.
JS script, jquery and stylesheet mentioned on the page above is included in the header.
Scripts, html, php files, stylesheets all have proper
644
or755
chmod
on them. So it shouldn't be a permissions issue(?)The page itself is saved as
.php
and not 'html'.- The 'ref.bib' file's contents are proper and have been tested on the website I linked above. It should work.
- Used this website to validate my HTML. My HTML syntax should be free of errors.
Console shows me this:
jQuery.Deferred exception: $(...).size is not a function @http://mywebsite.edu/~me/group/bibtextohtml.js:446:9 l@https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29373 a/https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29677 undefined
TypeError: $(...).size is not a function[Learn More]
Question:
How can I get it to work like it shows on the website linked above? Is it a problem with PHP inside textarea tags or something else?