query string - javascript add querystring within script -
i using galleria script website, facebook mod. want modify bit, albumid should showing, id given in query string.
my code is:
galleria.run('#galleria', { facebook: 'album:000000000', width: 745, height: 550, lightbox: true});
where want album:000000000, album:-querystring albumid-
for example, page album.php?albumid=123456, want code be:
galleria.run('#galleria', { facebook: 'album:123456', width: 745, height: 550, lightbox: true});
could me code?
i can't claim familiarity galleria, have used js function below grab query string variable values.
function parseurlparams(name, locat) { var results = new regexp('[\\?&]' + name + '=([^&#]*)').exec(locat); if (results) { return results[1] || ""; } else { return ""; } }
so if include above function in project, potentially set code so:
galleria.run('#galleria', { facebook: 'album:' + parseurlparams("albumid", window.location.href), width: 745, height: 550, lightbox: true});
hope helps!
Comments
Post a Comment