Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    419
    Thanks
    18
    Thanked 2 Times in 2 Posts

    edit url when page loaded into index

    Kind of a new thing for me... I have a navigation, that loads content into the index page. But this makes the sub pages uncrawlable. I want to load that location in the url, so the user can click forward/back through the loaded pages as well.

    In other words, if they're on index.php, and they click "contact", the contact.php file is loaded into the index page, and the url shows "website.com/contact"

    If they go through a few more links, they can go back and forth through those urls, even though it's just the one page.


    Right now, I just have this:
    javascript
    Code:
    <script
    $("#top_nav li a").on("click", function(){
    
    				// highlight active nav link & turn off others
    				
    				$('.current').attr('class','link1');
    				$(this).attr('class','current');
    				
    				// which page chosen?
    				var loadpage = 'inc/'+$(this).attr('name')+'.php';
    				
    				// fade out the main box			
    				$('#main_center_box').stop().animate({ opacity: 0 }, 700, function() { 
    				
    					// now load the page that matches navigation selected
    					$('#main_center_box').load(loadpage).stop().animate({ opacity: 1 }, 700, function() { /* animation complete */ }); 
    					
    				});
    	
    	});
    <script>
    and the page itself:
    Code:
    <ul id="top_nav">
    			<li class="nav_item">
    				 <a  id="about" class="link1" href="#" name="name">name</a>
    			</li>			
    			
    			<li class="nav_separator"> / </li>	
    				
    			<li class="nav_item">
    				<a id="new_sites" class="link1" href="#" name="new_sites">
    				NEW SITES
    				</a>
    			</li>
    			
    			<li class="nav_separator"> / </li>	
    				
    			<li class="nav_item">
    				<a id="portfolio" class="link1" href="#"  name="portfolio">
    				PORTFOLIO
    				</a>
    			</li>
    			
    			<li class="nav_separator"> / </li>	
    			
    			<li class="nav_item">
    				<a id="team" class="link1" href="#" name="team">
    				STRATEGY
    				</a>
    			</li>
    			
    			<li class="nav_separator"> / </li>	
    			
    			<li class="nav_item">
    				<a id="vip_first" class="link1" href="#" name="vip_first">
    				VIP FIRST
    				</a>
    			</li>
    			
    			<li class="nav_separator"> / </li>	
    			
    			<li class="nav_item">
    				<a id="contact" class="link1" href="#" name="contact">
    				CONTACT
    				</a>
    			</li>
    
    <div id="main_center_box" class="" style="opacity:0;display:none;">
    <-- this is where the content will load -->
    	</div>

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    As far as I know, it would be a security issue to manipulate the URL, like that. I don't think it's possible.

    I could be wrong.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Posts
    419
    Thanks
    18
    Thanked 2 Times in 2 Posts
    I do see that there's some sort of address deeplinking script, but I'm not sure how to fold that into what I'm doing...

    This is what I found:
    http://www.asual.com/jquery/address/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •