Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

jQuery ViewTree

Im attempting to build a simple Tree navigation structure using jQuery (very unexperienced with jQuery), and when I run the code, I get 'Expected identidier' on the line '$("#divBranch_" . nodeID . "_open").html(html);'

The idea is when you click on a folder it fires an AJAX request to fill in the code, and puts in the responded HTML into id "divBranch_00000-00000-00000_open"

<HTML>
<HEAD>
    <script type="text/javascript" src="jquery-1.6.4.min.js"></script>
</HEAD>
<BODY>
			<div id="divTree" style="width:200px; height:500px; float:left;">
				<script type="text/javascript">
					$(document).ready(function() {
						$(".folderTriggerShow").click(function(nodeID) {
							$.ajax({
								type: 'GET',
								url: 'viewTree.htm?TreeNode=' . nodeID,
								dataType: 'html',
								success: function(html, textStatus) {
									$("#divBranch_" . nodeID . "_open").html(html);
									$("#divBranch_" . nodeID . "_open").css('display','inline');
									$("#divBranch_" . nodeID . "_closed").css('display','none' );
								},
								error: function (xhr, textStatus, errorThrown) {
									$("#error").append("Failed - " + errorThrown ? errorThrown : xhr.status);
								}
							})
						});
					})
					
					$(document).ready(function() {
						$(".folderTriggerHide").click(function(nodeID) {
							$("#folderTriggerHide").html("");
							$("#divBranch_" . nodeID . "_open").css('display','none');
							$("#divBranch_" . nodeID . "_closed").css('display','inline' );
						});
					})
				</script>
				
				<div class="folderTriggerShow" id="divBranch_00000-00000-00000_closed" style="display:inline;">
					<img src="closedFolder.jpg" />Base Folder<br>
				</div>
				<div class="folderTriggerHide" id="divBranch_00000-00000-00000_open" style="display:none;">
				</div>
			</div>
</BODY>
</HTML>

Open in new window


Any ideas what Im doing wrong?

Thank you for any assistance.
SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tonelm54
tonelm54

ASKER

Stupid me and concat!!!


Thank you