Foros del Web » Programando para Internet » Javascript »

¿Cómo agregar "hash"? Para cambiar URL y no recargar página

Estas en el tema de ¿Cómo agregar "hash"? Para cambiar URL y no recargar página en el foro de Javascript en Foros del Web. Buenas a todos. Soy pionero en esta aventura de este foro. Resulta que tengo un proyecto en AJAX y necesito agregar un hash para identificar ...
  #1 (permalink)  
Antiguo 01/03/2013, 19:55
 
Fecha de Ingreso: marzo-2013
Mensajes: 1
Antigüedad: 11 años, 2 meses
Puntos: 0
Mensaje ¿Cómo agregar "hash"? Para cambiar URL y no recargar página

Buenas a todos. Soy pionero en esta aventura de este foro.
Resulta que tengo un proyecto en AJAX y necesito agregar un hash para identificar la URL y no recargar página.

Necesito alguna idea de cómo porder lograrlo, por favor.

Proyecto en funcionamiento:
[URL="http://rachmanijquery.site88.net/"]http://rachmanijquery.site88.net/[/URL]

html:

Código:
<ul id="countrytabs" class="shadetabs">
<li><a href="#" rel="#default" class="selected">Tab 1</a></li>
<li><a href="external2.htm" rel="countrycontainer">Tab 2</a></li>
<li><a href="externalnested.html" rel="countrycontainer">Tab 3</a></li>
<li><a href="external4.htm" rel="#iframe">Tab 4</a></li>
</ul>

<div id="countrydivcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
<p>This is some default tab content, embedded directly inside this space and not via Ajax. It can be shown when no tabs are automatically selected, or associated with a certain tab, in this case, the first tab.</p>
</div>
js:

Código:
if (pageurl.indexOf("externalnested.html")!=-1){
provinces=new ddajaxtabs("provincetabs", "provincedivcontainer")
provinces.setpersist(true)
provinces.setselectedClassTarget("link") //"link" or "linkparent"
provinces.init()
provinces.onajaxpageload=function(pageurl){
if (pageurl.indexOf("externalnested2.htm")!=-1){
cities=new ddajaxtabs("citytabs", "citydivcontainer")
cities.setpersist(true)
cities.setselectedClassTarget("link") //"link" or "linkparent"
cities.init()
}
}


}
}
Siempre ayudar gratifica!
  #2 (permalink)  
Antiguo 02/03/2013, 11:12
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: ¿Cómo agregar "hash"? Para cambiar URL y no recargar página

ya ni siquiera están usando el hash, ahora se usa esto
http://www.forosdelweb.com/f4/cambia...8/#post4295520
SAludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.

Etiquetas: ajax, js
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:56.