Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

div "with twitter class" conditional reload

Posted on 2014-01-20
6
511 Views
Last Modified: 2014-02-03
I have a page of the following which is part of my web application, the page work well when you visit it for the for the first time from your browser, but when you move to other page with in the website and get back to it, it shows only the URL links rather displaying the class itself, I do not know what is the problem, I believe that the page is not reloaded again, is there away to make a conditional reload to reload the div if I return to the page again?
 
     <style>
          #twheader {
           position: fixed;
           margin-left: 5px;
           height: 100px;
           background: #fff;
           overflow-y:hidden;
           overflow-x:hidden
           }
          #twcontents {
           position: fixed;
           margin-top: 25px;
           margin-left: 5px;
           height: 700px;
           margin-left: 5px;
           background: #FFF;
           border-style:ridge;
           overflow: auto;
           }
          #twheader h3 {
           text-align: left;
           margin: 0;
           font-family:"Helvetica Neue", Helvetica, sans-serif;
           font-size: 20px;
           color: #55ACEE;
           background: #FFF;
                    }
           .ui-dialog > .ui-widget-header {
                                      text-align: left;
                                       margin: 0;
                                       font-family:"lucida grande",tahoma,verdana,arial,sans-serif;
                                       font-size: 16px;
                                       color: #FFF;
                                       background: #3B5998;
                                      }
        </style>
        <script type='text/javascript'>
          !function(d,s,id){
          var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
          if(!d.getElementById(id)){js=d.createElement(s);
          js.id=id;
          js.src=p+"://platform.twitter.com/widgets.js";
          fjs.parentNode.insertBefore(js,fjs);
          }
        }
        (document,"script","twitter-wjs");
        </script>
             <div id="twheader">
               <h3 class="ui-widget-header">&nbsp;&nbsp;twitter&nbsp;&nbsp;</h3>
              </div>
              <div id="twcontents">
                     <table><tr><td>
                      <div id="twcontents1container" style="height:100%;width:100%;">
                       <a class="twitter-timeline" href="https://twitter.com/myfeed1" data-widget-id="mywidget1">Tweets from
https://twitter.com/myuser/myfeed1</a>;
                         </div>
                       </td><td>
                       <div id="twcontents2container" style="height:100%;width:100%;">
                        <a class="twitter-timeline" href="https://twitter.com/myfeed2" data-widget-id="mywidget2">Tweets from https:/
/twitter.com/myuser/myfeed2</a>
                       </td><td>
                        <a class="twitter-timeline" href="https://twitter.com/mfeed3" data-widget-id="mywidget3">Tweets from h
ttps://twitter.com/myuser/myfeed3</a>
                        </td></tr></table>
                         </div>
              </div>

Open in new window

0
Comment
Question by:Ashraf Hassanein
  • 3
  • 2
6 Comments
 
LVL 23

Expert Comment

by:Ioannis Paraskevopoulos
ID: 39796352
Hi,

do you have any live example of your page?

Giannis
0
 
LVL 9

Expert Comment

by:Sar1973
ID: 39796555
You could add an onload event to the page (body) that fires the reload if the current page is the same:
if (location.href==(page URL)) {window.location.href==(page URL);}
but in this way I suspect that you will create a loop, since whenever the page is loaded its URL will correspond to the location reference.
0
 

Author Comment

by:Ashraf Hassanein
ID: 39814386
URL: https://www.hassans.nl/test 
username/password: guest/guest
From the menu you can select twitter.

I tried to solve this reload of the page, but it does not work.
0
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 

Author Comment

by:Ashraf Hassanein
ID: 39818225
@Sar1973 but I want to reload only one dive in the page. how I can do so?
0
 
LVL 9

Accepted Solution

by:
Sar1973 earned 500 total points
ID: 39820371
You could assign the event to the div instead of the page.
0
 

Author Comment

by:Ashraf Hassanein
ID: 39829893
@Sat1973 thank you so much it worked pretty well.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question