Jump to content

Pavlos1316

Members
  • Posts

    302
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Pavlos1316's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Pavlos1316

    SEO

    hi, which is better to use for my internal linked pages: www.example.com/my-test-subject1 or www.example.com/subject1 If someone makes a search for subject1 will both appear or...?
  2. I have the below code to open contents in a div or modal window and at the same time showing the url that matches the specified page which works as expected, no problems rising: $(document).ready(function(){ ///////LINK in a Div//////// $('#all').delegate('a.img-lnk, a.txt-lnk', 'click', function(){ $('#main').empty(); var page = $(this).attr('id'); var pageurl = $(this).attr('data-seo'); $('#main').load("../"+ page + ".php"); window.history.pushState('','',pageurl); }); ///////LINK in a Modal Window//////// $('#all').delegate('a.pop-lnk', 'click', function(){ var poppage = $(this).attr('id'); var popurl = $(this).attr('data-seo'); $('#popup').load("../char-inf/"+ poppage + ".php"); window.history.pushState('','',"/char-inf/"+ popurl); }); $('body').delegate('.hide-it', 'click', function(){ $('.hide-it').hide(); $('#popup').empty(); window.history.back(); }); }); Problem: If I give you a url of a link in my page e.g. www.example.com/test1 and paste it in your browser the test1 page will open normally, BUT after that if you navigate to page test2 then the new url becomes www.example.com/test1/test2. Is there a way to turn the url at its normal state which would be www.example.com/test2?
  3. Thank you very much... I wasn't aware for the data- tag and seems very helpful.
  4. In HTML5 some attributes are no longer supported eg: name attr for <a> is no longer supported. What happens when in a tag like <a> exists a non supported attr? <a id="me" name="you"> Will it just be ignored like is not there or it can cause problems later on and how?
  5. I just had not to use the '' when using the variable. window.history.pushState('','',page);
  6. Is there a way to change the url in the code below using window.history.pushState dynamically to match the "page" variable? $(document).ready(function(){ $('#all').delegate('a.pop-lnk', 'click', function(){ var page = $(this).attr('id'); $('#popup').load("../folder/"+ page + ".php"); window.history.pushState('','','/page'); }); });
  7. I have couple jquery codes in a single file: $(document).ready(function(){ $('#all').delegate('a.link', 'click', function(){ //more code here }) $('body').delegate('.nice', 'click', function(){ //more code here }) }); This works great but is it better to close each function using ; symbol? Even if I do or not the code works ok, BUT whats the correct way?
  8. I am stupid I was trying your answer the last hour... Forgot to add the full path ../help-file/ that's why it wasn't working Now that I saw it written by you I realized!!! Thank you by the way... I will mark it as best answer.
  9. loop.php does nothing important. just checking if page exists but that is carried out by the server. I have eg 2 links: <a id="test1" class="pop-lnk"> <a id="test2" class="pop-lnk"> By clicking the link I use my JQ code to open the information of test1.php in a modal window. But the loop.php takes the IDvalue from my <a> and adds the .php extension so JQ can load the file. Can JQ add the .php extension so I skip loop.php?
  10. I am using this to open contents into a modal window, but in the process I am passing it through loop.php to check if the page exists and then load. Is there a way to completely skip the loop.php file and load my clicked link? $(document).ready(function(){ ///////LINK in a Modal Window//////// $('#all').delegate('a.pop-lnk', 'click', function(){ var page = $(this).attr('id'); $('#gr-out').css({ opacity: 0.7, 'width':$(document).width(),'height':$(document).height()}).show(); $('#popup').css({'display': 'block'}); $('#popup').load("../help-file/loop.php?page="+ page); }); }); The id attr I am getting from this code is my page's name but I need to add the .php extension if is possible so I can load the page.
  11. I use this code to open the contents of my Menu Links inside my <div id="main"> so I do not need to reload the whole page each time: .delegate('a.difflink', 'click', function(){ $('#content').empty(); var page = $(this).attr('id'); $('#content').load("page_scripts/loop_a.php?page="+ page); Problem created is that by using the above method my browser's address bar always shows www.myXample.com so I cannot create sitemap for SEO. And as I understood (not sure if I am correct) the way I made it work is like there are no new urls to show (since I am just changing div content). QUESTION: Is there a way to make my page work as it should e.g when I press "Downloads" --- address will show: www.myXample.com/downloads and still no need to reload the whole page? A solution would be to use this in my code: window.history.pushState('','','/downloads'); it changes the url to the desired BUT if I manually enter on my browser www.myXample.com/downloads I get just the contents of the div without any page formatting or menus, which is natural result. So is there a work around to achieve my goal or is it one of two: Reloading the whole page Vs No reloading and no URLs for SEO.
  12. This is my downloading script: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <?php // block any attempt to the filesystem if (isset($_GET['file']) && basename($_GET['file']) == $_GET['file']) { $filename = $_GET['file']; } else { $filename = NULL; } $err = '<p>ERROR</p>'; if (!$filename) { // if variable $filename is NULL or false display the message echo $err; } else { // define the path to your download folder plus assign the file name $path = '../downloads/'.$filename; // check that file exists and is readable if (file_exists($path) && is_readable($path)) { // get the file size and send the http headers $size = filesize($path); header('Content-Type: application/octet-stream;'); header('Content-Length: '.$size); header('Content-Disposition: attachment; filename='.$filename); header('Content-Transfer-Encoding: binary'); // open the file in binary read-only mode // display the error messages if the file canĀ“t be opened $file = @ fopen($path, 'rb'); if ($file) { // stream the file and exit the script when complete fpassthru($file); exit; } else { echo $err; } } else { echo $err; } } ?> </body> </html> and this is how I call it: <a href="script/download.php?file=File_Name.doc" class="dload">03. File Name</a> If I have the name in English everything is ok. If I change it to greek, I get the ERROR msg! I need it in Greek. Any suggestions?
  13. I will do it later... Where I am now the firewall doesn't give me access to my server...
  14. I cannot understand... All my other pages are working...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.