Announcement

Collapse
No announcement yet.

Javascript dependence

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    A web based package should use php in preference to javascript
    This unfortunately degrades the experience for the customer as they have to wait for their responses to be sent and a new page to be fetched from the server. With client side JavaScript, the response is immediate.

    Also, at the moment Actinic does not require PHP on the server so you'd be adding a new requirement to the existing server setup.

    However I'd happily swap the dependence on server-side Perl for server-side PHP.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #32
      Originally posted by NormanRouxel View Post
      However I'd happily swap the dependence on server-side Perl for server-side PHP.
      gawd, i'd not only welcome it, but i'd walk all the way to west byfleet go give everyone a chocolate muffin and a great big hug.

      Comment


        #33
        try using something like jquery. it'd give actinic a great visual and functional boost.

        the jquery people make a big effort for compatibility, so you don't have to.

        The web without javascript, is like a wine glass without wine.

        Comment


          #34
          JavaScript

          Gabriel Crowe The web without javascript, is like a wine glass without wine.
          I agree Gabe-JavaScript is an integral part of the web now.
          I think keep things the way they are.
          I don't see very many people at all that have JS turned off in our stats. As others have said a large part of the web experience is now semi or even fully reliant on JS, what would you replace it with?
          To be honest I have had more people who have problems placing orders because they are using networked computers with cookies blocked than JS causes.
          I say keep it in but don't make Actinic reliant on it, just use it to add the little extra bits.
          Steve Griggs.

          "People in business often miss opportunities, mainly because they usually arrive dressed in overalls and looking like work."



          www.kitchenwareonline.com
          www.microwave-repair.co.uk

          Comment


            #35
            Originally posted by gabrielcrowe View Post
            try using something like jquery. it'd give actinic a great visual and functional boost.

            the jquery people make a big effort for compatibility, so you don't have to.
            I used several javascripts that used jquery to provide graphics effects in Actinic, highly versatile and very small library of code, definitely gets my vote as the most useful tool.

            Malcolm

            SellerDeck Accredited Partner,
            SellerDeck 2016 Extensions, and
            Custom Packages

            Comment


              #36
              Originally posted by NormanRouxel View Post
              This unfortunately degrades the experience for the customer as they have to wait for their responses to be sent and a new page to be fetched from the server.
              It is possible to implement PHP on the server to provide dynamic code inside an Actinic web page. I did it recently when working on some code to display customer reviews from a MySql database hosted on the server, directly into the Actinic product pages. It acts just like a javascript would but uses the server instead of the local PC.

              So it doesn't necessarily cause delays, just depends on what you are trying to achieve, and that is a question only Actinic can answer.

              Malcolm

              SellerDeck Accredited Partner,
              SellerDeck 2016 Extensions, and
              Custom Packages

              Comment


                #37
                It is possible to implement PHP on the server to provide dynamic code inside an Actinic web page.
                If this is on any pages that display products, then it's very difficult to do cleanly as a page viewed via the search results (with highlighting) or any logged-in business users have their pages output from Perl scripts and that's makes it very tricky to parse embedded PHP.

                A tutorial on how to achieve this would be very useful.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #38
                  Originally posted by NormanRouxel View Post
                  If this is on any pages that display products, then it's very difficult to do cleanly as a page viewed via the search results (with highlighting) or any logged-in business users have their pages output from Perl scripts and that's makes it very tricky to parse embedded PHP.

                  A tutorial on how to achieve this would be very useful.
                  Not sure what you mean by the search function, if I enter a search term on say the home page, I get a list of links to pages, when I select the link the page displays as it should using the embedded php, or am I missing something? Demo here http://demo.toddesigns.co.uk/acatalo...preview_2.html

                  EDIT changed link to directly point to the page, reason for using the previous link was it came directly from using a search.

                  The review part of the page is supplied via a call to a php function.

                  Malcolm

                  SellerDeck Accredited Partner,
                  SellerDeck 2016 Extensions, and
                  Custom Packages

                  Comment


                    #39
                    Have you tried following the link?

                    Comment


                      #40
                      Malcolm,

                      You're not using embedded server-side PHP on these pages. E.g. Standard html of page<?php // do something ?> html continues. which is what most people would consider embedded PHP to be. You're doing e.g.
                      Code:
                      <script language="JavaScript" type="text/javascript" src="DisplayReview.php?prodRef=5">
                      Where the HTML of the page loads into the browser and the line above then returns a snippet of JavaScript (that presumably document.writes out the review stars and text).

                      If you did have embedded PHP it's unlikely that it would be processed the search results are produced by a Perl script that reads the page file, locates matching words, adds colour tags around them and spits out the resulting modified HTML. And, of course, the page name doesn't end in .php (or .html either) as it's a cgi script call.
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #41
                        as i understand it (i ahve encountered this before) perl loads the page data from the file itself, and bypasses the php interpreter.

                        many moons ago, i modified the perl call, to load via url, like php's file_get_contents.

                        sadly, performance was the suck.

                        Comment


                          #42
                          Originally posted by leehack View Post
                          Have you tried following the link?
                          yes it works for me direct from this screen

                          Malcolm

                          SellerDeck Accredited Partner,
                          SellerDeck 2016 Extensions, and
                          Custom Packages

                          Comment


                            #43
                            yes it works for me direct from this screen
                            CGI based links posted on the forum only work for people who've already got a recent cookie from the site on their system. Everyone else gets a page where all the CSS, JavaScript, images, etc are attempting to come from community.actinic.com. Result - text only mush.

                            I, instead, went to http://demo.toddesigns.co.uk and used the Search from there.
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                              #44
                              Originally posted by NormanRouxel View Post
                              Malcolm,

                              You're not using embedded server-side PHP on these pages. E.g. Standard html of page<?php // do something ?> html continues. which is what most people would consider embedded PHP to be. You're doing e.g.
                              Code:
                              <script language="JavaScript" type="text/javascript" src="DisplayReview.php?prodRef=5">
                              .
                              Norman

                              DisplayReview.PHP is a php file on the server the use of the javascript around it allows the browser to ask the server to run the code passing the product ID into the php code. The PHP code then checks the online database, if there are no reviews it return a line asking to be the first to review, if it finds entries it returns the data formatted in html. I do hope you agree that the following snippet is php code

                              Code:
                              	if ( $resultNo > 1) {
                               		$response = "There are " . $resultNo . " reviews for this product";
                              		$count = $resultNo - 1;
                              	}
                              	else {
                               		$response = "There is " . $resultNo . " review for this product";
                              		$count = 1;
                              	}
                               	echo "document.write('$response');";
                               	echo "document.write('<br><br><br>');";
                              	// get last two reviews rather than the first two
                              	for ($index = $resultNo; $index >= $count; $index--) {
                              		// select the row in the database (runs from 0 to n-1)
                              		$dataOk = mysql_data_seek($result, $index - 1);
                              		// now fetch the data 
                              		$line = mysql_fetch_array($result, MYSQL_ASSOC);
                              
                              		// print the reviews
                              		$pic = "rating" . $line['rating'] . ".gif";
                              		$toBeInserted = '<img src="' . $pic . '" />';
                               		echo "document.write('$toBeInserted');";
                               		echo "document.write('<br>');";
                              		
                              		$toBeInserted = $line['review'];
                               		echo "document.write('$toBeInserted');";
                               		echo "document.write('<br><br>');";
                              		
                              		$toBeInserted = "Reviewed by <i>" . $line['reviewer'];
                               		echo "document.write('$toBeInserted');";
                               		echo "document.write('</i><br><br><br>');";
                              	}
                              	if ($resultNo > 2) {
                              		$ReadReview = 'ReadReview.php?prodRef='. $ref;
                              		$toBeInserted = '<a href="'.$ReadReview.'" onclick=return popitup ("'.$ReadReview.'")>Read all the reviews ........</a>';
                              //		$toBeInserted = '<a href=ReadReview.php?prodRef='. $ref .'>Read more reviews ........</a>';
                              		echo "document.write('$toBeInserted');";
                               		echo "document.write('<br>');";

                              Malcolm

                              SellerDeck Accredited Partner,
                              SellerDeck 2016 Extensions, and
                              Custom Packages

                              Comment


                                #45
                                what i think norman is saying, is that your php is not embedded into the page, its called by a script tag.

                                replace the script tag with your code and see what happens.

                                Comment

                                Working...
                                X